Difference between Git and Nexus?

There are both referential: one (Git) is a source referential for version control (with features like merging, branching, tags) the other (Nexus) is an artifact referential for any delivery (binaries or not) The referential database differs also: Git has its own internal repository storage mechanism Nexus is simply a collection of shared directories with a … Read more

Where do I put my credentials when using Ivy and a private company repository?

Use a settings file with properties controlling the Nexus credentials: <ivysettings> <property name=”repo.host” value=”default.mycompany.com” override=”false”/> <property name=”repo.realm” value=”Sonatype Nexus Repository Manager” override=”false”/> <property name=”repo.user” value=”deployment” override=”false”/> <property name=”repo.pass” value=”deployment123″ override=”false”/> <credentials host=”${repo.host}” realm=”${repo.realm}” username=”${repo.user}” passwd=”${repo.pass}”/> .. .. </ivysettings> When you run the build you can then specify the true username and password: ant -Drepo.user=mark -Drepo.pass=s3Cret … Read more

Maven Snapshot Repository vs Release Repository

Release repositories hold releases and Snapshot repositories hold snapshots. In maven a snapshot is defined as an artifact with a version ending in -SNAPSHOT. When deployed, the snapshot is turned into a timestamp. By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don’t care … Read more

Maven release plugin fails : source artifacts getting deployed twice

Try running mvn -Prelease-profile help:effective-pom. You will find that you have two execution sections for maven-source-plugin The output will look something like this: <plugin> <artifactId>maven-source-plugin</artifactId> <version>2.0.4</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> <execution> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> To fix this problem, find everywhere you have used maven-source-plugin and make sure that you … Read more

Using the Nexus rest API to get latest artifact version for given groupid/artifactId

The following URL will retrieve the latest version of log4j 1.2.x: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST Documented here Update Example using curl: curl -L “http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST” -o log4j.jar Update for Log4j2 Log4j 1.2 is EOL since summer 2015 and is known to be broken in Java 9. Here is the link for the Log4j artifacts: log4j-api: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-api&v=LATEST log4j-core: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.apache.logging.log4j&a=log4j-core&v=LATEST

How to access a secured Nexus with sbt?

Here’s what I did (sbt 0.13 + artifactory – setup should be similar for nexus): 1) Edited the file ~/.sbt/repositories as specified here: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html [repositories] local my-ivy-proxy-releases: http://repo.company.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases: http://repo.company.com/maven-releases/ 2) Locked down my artifactory to disable anonymous access. 3) Created a credentials file in ~/.sbt/.credentials realm=Artifactory Realm host=artifactory.mycompany.com user=username password=password 4) Created a … Read more