Nexus Proxy Repo does not want to fetch - maven-2

I am using nexus 1.9.2. I setup a proxy repo to a remote location (which can be accessed via http://somelocation.com). I added this proxy repo to Nexus' Public Repositories group. My maven's settings.xml is set to use Nexus (in the <mirror /> section).
When I login to Nexus via a web browser and click on this newly added proxy repo and then to Browse Remote tab I can see all the artifacts. However, when I click the tabs Browse Storage or Browse Index I do not see any artifact.
When I do mvn clean install I do get missing artifact, it simply does not want to fetch from the remote site.
I am getting the following
1 required artifact is missing.
for artifact:
com.somelocation:someserverapp:jar:1.1.0-SNAPSHOT
from the specified remote repositories:
release-repo (http://localrepo:8081/nexus/content/groups/public),
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
1) com.somelocation:somelocation-networking-packet:jar:1.0.0
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.somelocation -DartifactId=somelocation-networking-packet -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.somelocation -DartifactId=somelocation-networking-packet -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.somelocation:someserverapp:jar:1.1.0-SNAPSHOT
2) com.somelocation:somelocation-networking-packet:jar:1.0.0
Any ideas why?

Related

IntelliJ Ktor and Docker is there a better way?

So I started a ktor project in IntelliJ it runs fine there. However, I am attempting to now have docker use the jar created from the build/libs directory and I get this error:
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/application/Application
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: io.ktor.application.Application
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
This is what my ktor.Dockerfile looks like:
FROM openjdk:8-jre-alpine
ENV APPLICATION_USER ktor
RUN adduser -D -g '' $APPLICATION_USER
RUN mkdir /app
RUN chown -R $APPLICATION_USER /app
USER $APPLICATION_USER
COPY ./build/libs/website-0.0.1.jar /app/website-0.0.1.jar
WORKDIR /app
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-cp", "website-0.0.1.jar", "com.diracian.ApplicationKt"]
What I did first was start a ktor project, and after I got that working, I started working on my Dockerfile.
Actually, ended up breaking it up in pieces.
My file looks like this now and works:
FROM gradle:jdk10 as builder
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build
FROM openjdk:10-jre-slim
EXPOSE 8080
COPY --from=builder /home/gradle/src/build/distributions/website-0.0.1.tar /app/
WORKDIR /app
RUN tar -xvf website-0.0.1.tar
WORKDIR /app/website-0.0.1
CMD bin/website

How to build leon for MacOSX?

I tried to follow the instructions to build leon for MacOSX (yosemite) from the README.md file on github.
It worked well except that when I run the basic test, I get a problem with a scalaz3 library not found:
$ ./leon ./testcases/verification/sas2011-testcases/RedBlackTree.scala
java.lang.UnsatisfiedLinkError: no scalaz3 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at z3.Z3Wrapper.loadFromJar(Z3Wrapper.java:97)
at z3.Z3Wrapper.<clinit>(Z3Wrapper.java:47)
at z3.scala.Z3Config.<init>(Z3Config.scala:6)
at leon.solvers.z3.FairZ3Solver.<init>(FairZ3Solver.scala:50)
at leon.solvers.SolverFactory$$anonfun$leon$solvers$SolverFactory$$getSolver$1$1$$anon$1.<init>(SolverFactory.scala:50)
at leon.solvers.SolverFactory$$anonfun$leon$solvers$SolverFactory$$getSolver$1$1.apply(SolverFactory.scala:50)
at leon.solvers.SolverFactory$$anonfun$leon$solvers$SolverFactory$$getSolver$1$1.apply(SolverFactory.scala:50)
at leon.solvers.SolverFactory$$anon$12.getNewSolver(SolverFactory.scala:18)
at leon.verification.AnalysisPhase$.checkVC(AnalysisPhase.scala:129)
at leon.verification.AnalysisPhase$$anonfun$10.apply(AnalysisPhase.scala:111)
at leon.verification.AnalysisPhase$$anonfun$10.apply(AnalysisPhase.scala:110)
at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727)
at leon.verification.AnalysisPhase$.checkVCs(AnalysisPhase.scala:110)
at leon.verification.AnalysisPhase$.run(AnalysisPhase.scala:45)
at leon.verification.AnalysisPhase$.run(AnalysisPhase.scala:15)
at leon.Pipeline$$anon$1.run(Pipeline.scala:12)
at leon.Pipeline$$anon$1.run(Pipeline.scala:12)
at leon.Main$.execute(Main.scala:236)
at leon.Main$.main(Main.scala:220)
at leon.Main.main(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at scala.reflect.internal.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:101)
at scala.reflect.internal.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101)
at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:22)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:39)
at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:29)
at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:39)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:65)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
I tried to build the ScalaZ3 package from EPFL which requires building Microsoft's Z3 (from github). Building z3 itself works find but building ScalaZ3 fails with a missing "gomp" library:
[error] ld: library not found for -lgomp
[error] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[info] Bundling files:
[info] - /Users/rouquett/git.leon/ScalaZ3/lib-bin/libscalaz3.dylib -> lib-bin/libscalaz3.dylib
[info] - /Users/rouquett/git.leon/ScalaZ3/z3/4.3-osx-64b/lib/libz3.dylib -> lib-bin/libz3.dylib
[info] - /Users/rouquett/git.leon/ScalaZ3/z3/4.3-osx-64b/lib/python2.7 -> lib-bin/python2.7
[info] Packaging /Users/rouquett/git.leon/ScalaZ3/target/scala-2.10/scalaz3_2.10-2.1.jar ...
[info] Done packaging.
I found that there is a Clang OMP library here for MacOSX:
http://brewformulas.org
However, this may require tweaking some build scripts to point to brew's installation of clang-omp.
Has anyone experienced similar problems or solved them?
Nicolas.
These are the steps I followed to get the latest version of Leon running on OSX:
git clone git#github.com:epfl-lara/leon.git
cd leon
git remote add osx git#github.com:mantognini/leon.git
git fetch osx
git checkout osx
git rebase origin/master # adds precompiled OSX binaries
sbt clean compile script
Make sure to link the leon binary to your $PATH, for example after the last step run ln -sv $(pwd)/leon /usr/local/bin/leon.
To update the binary to the latest version of Leon, run
git fetch origin
git rebase origin/master
sbt clean compile script
Assuming you are on the osx branch.

error occurs while generating apk file using android-maven-plugin

`I am using android eclipse,i develop a project and add the dependencies GOOGLE play services,
app compact v7 in build path.When i run it as a normal android project it is perfectly executing,I add maven POM.XML file to generate APK file,when i proceed to maven install it gives error.
Error :
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:608)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:229)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "D:\NagarjunaWork\android\adt-bundle-windows-x86_64-20140321\sdk\build-tools\android-4.4.2\aapt.exe package -f --no-crunch -I D:\NagarjunaWork\android\adt-bundle-windows-x86_64-20140321\sdk\platforms\android-19\android.jar -M D:\5-8-2014\QuickRideApp\QuickRide\AndroidManifest.xml -S D:\5-8-2014\QuickRideApp\QuickRide\res -A D:\5-8-2014\QuickRideApp\QuickRide\target\generated-sources\combined-assets -m -J D:\5-8-2014\QuickRideApp\QuickRide\target\generated-sources\r --output-text-symbols D:\5-8-2014\QuickRideApp\QuickRide\target --auto-add-overlay", Result = -1073741819
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:252)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:604)
... 23 more
This can be caused by problems in your XML files, such as referring to a resource ID that no longer exists or never existed. See MojoExecutionException: Maven with Android and aapt.exe has stopped working for possible solutions.

Maven: Trouble deploying third party JAR to a remote repository

I'm using Maven 3. I'm trying to deploy a third party artifact to a remote repository but am getting a strange error. The command I'm using to deploy is
mvn deploy:deploy-file -DgroupId=com.myco.util.ant \
-DartifactId=selenium-ant-task \
-Dversion=1.4 \
-Dpackaging=jar \
-Dfile=/Users/davea/.m2/repository/com/myco/util/ant/selenium-ant-task/1.4/selenium-ant-task-1.4.jar \
-DrepositoryId=sonatype-nexus \
-Durl=http://sonatype.myco.com/nexus/content/repositories/releases
And the error I get when I run this command is
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project maven-selenium-plugin: The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file are missing or invalid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
What's going on here? I have defined my repositoryId, "ssonatype-nexus" in my ~/.m2/settings.xml file and verified the credentials in there are correct.
Thanks for any help, - Dave
deploy:deploy-file is not intended to be run in a directory with a pom.xml file - you should run it somewhere else. If you want a specific POM uploaded with it, don't forget the -DpomFile argument as the default is to generate a basic one.
However, I notice that you're deploying a file from the local repository - if this was placed there by a Maven build you are certainly better to have that project do the deployment, using the <distributionManagement> element and deploy lifecycle phase.
Seems like your url is formatted incorrectly.
Try:
-Durl=file://path_to_m2_repo
See here for more.
Edit: Note, the URL is for the local repo in this case. Maven should deploy to a Nexus based on the POM and -DrepositoryId.

maven and lift using scala 2.8 : lift-mapper missing?

Newbie question since I'm not up to speed using
maven at all.
I'm trying to use scala + lift using scala 2.8, environment
is a win7 box if that matters.
I create a basic project using:
mvn archetype:generate -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=2.0-scala280-SNAPSHOT -DarchetypeRepository=http://scala-tools.org/repo-snapshots -DremoteRepositories=http://scala-tools.org/repo-snapshots -DgroupId=com.liftworkshop
-DartifactId=todo -Dversion=1.0-SNAPSHOT
So far so good, but then, I try to cd into my new project
and do:
mvn jetty:run
I after quite a few downloads end up with a error like below:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) net.liftweb:lift-mapper:jar:2.0-scala280-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-mapper -D
version=2.0-scala280-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-mapper -Dve
rsion=2.0-scala280-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dr
epositoryId=[id]
Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-mapper:jar:2.0-scala280-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
com.liftworkshop:todo:war:1.0-SNAPSHOT
from the specified remote repositories:
scala-tools.snapshots (http://scala-tools.org/repo-snapshots),
scala-tools.releases (http://scala-tools.org/repo-releases),
central (http://repo1.maven.org/maven2)
Any ideas?
I created the same project using the mvn archetype:generate command you provided but I couldn't reproduce your problem. The lift-mapper-2.0-scala280-SNAPSHOT.jar artifact is definitely in the scala snapshots repository and Maven downloaded it:
...
1619K downloaded (lift-mapper-2.0-scala280-SNAPSHOT.jar)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '0c857e2c5de9d5cabb7c972e519528606f19697b'; remote = 'a258cf7d7a49a8d7163d499da06a4d1e231a78e0' - RETRYING
Downloading: http://scala-tools.org/repo-snapshots/net/liftweb/lift-mapper/2.0-scala280-SNAPSHOT/lift-mapper-2.0-scala280-SNAPSHOT.jar
1619K downloaded (lift-mapper-2.0-scala280-SNAPSHOT.jar)
As you can see, Maven had to retry the download because of a failed CHECKSUM check but it worked.
Just try again.