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

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

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 do I get sbt to use a local maven proxy repository (Nexus)?

Step 1: Follow the instructions at Detailed Topics: Proxy Repositories, which I have summarised and added to below: (If you are using Artifactory, you can skip this step.) Create an entirely separate Maven proxy repository (or group) on your corporate Maven repository, to proxy ivy-style repositories such as these two important ones: http://repo.typesafe.com/typesafe/ivy-releases/ http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/ This … Read more

Upload artifacts to Nexus, without Maven

Have you considering using the Maven command-line to upload files? mvn deploy:deploy-file \ -Durl=$REPO_URL \ -DrepositoryId=$REPO_ID \ -DgroupId=org.myorg \ -DartifactId=myproj \ -Dversion=1.2.3 \ -Dpackaging=zip \ -Dfile=myproj.zip This will automatically generate the Maven POM for the artifact. Update The following Sonatype article states that the “deploy-file” maven plugin is the easiest solution, but it also provides … Read more

tech