My java / maven project called "testproject" connects to my jenkins and nexus repo:
My pom.xml looks like this:
.... <distributionManagement> <repository> <id>nexus</id> <name>RepositoryProxy</name> <url>http://nexus:8080/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>nexus</id> <name>RepositoryProxy</name> <url>http://nexus:8080/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> ......
In my jenkins settings, I have:
Build - maven3 - clean deploy
As expected, jenkins loads the artifact into Nexus.Look at the console output from the jenkins assembly, as shown below:
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ testproject --- [INFO] Building jar: /var/lib/jenkins/workspace/testproject/target/testproject-0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ testproject --- [INFO] Installing /var/lib/jenkins/workspace/testproject/target/testproject-0.1-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1- SNAPSHOT.jar [INFO] Installing /var/lib/jenkins/workspace/testproject/pom.xml to /var/lib/jenkins/.m2/repository/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1-SNAPSHOT.pom [INFO] [INFO] --- maven-deploy-plugin:2.5:deploy (default-deploy) @ testproject --- Downloading: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/maven-metadata.xml Downloaded: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/maven-metadata.xml (1012 B at 28.2 KB/sec) Uploading: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1-20120509.161644-74.jar Uploaded: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1-20120509.161644-74.jar (47 KB at 748.5 KB/sec) Uploading: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1-20120509.161644-74.pom Uploaded: http://nexus:8080/nexus/content/repositories/snapshots/com/dummy/testproject/0.1-SNAPSHOT/testproject-0.1-20120509.161644-74.pom (6 KB at 149.3 KB/sec)
Questions :
Given the version specified in pom.xml,
<version>0.1-SNAPSHOT</version>
How is it that jenkins loads testproject- 0.1-20120509.161644-74 .jar on Nexus? where is 20120509.161644-74 material coming from?
if timestamp 20120509.161644-74 is generated by jenkins before downloading, can I customize its format? I want to have something like testproject-01 - $ {timestamp} - $ {reversionId} .jar
source share