0
votes

I'm currently working on setting up a continuous integration environment that will use git as the source and Nexus as the Artifact repository.

I have configured 2 jobs in Jenkins.

  1. A maven build job that will parse the pom file in git and deploy the jar file to Nexus.
  2. A deploy job that will deploy the jar file from Nexus to application server(weblogic)

I need help in the below 2 areas.

1) When the jar is deployed to Nexus, the file will be in the format: -0.0.1-date&time-1.jar

Is there any way that i can modify this to just fileName.jar?

2) How do i setup the 2nd job to pick the jar file created by the first job? I'm looking for ways by which i can pass the version number to the deploy job dynamically.

2
I'm sure that what you want to achieve is possible. But maybe you could provide more info. eg. can we see a simplified version of your pom.xml file(s). Also my Jenkins is rusty, are you using a git plugin for jenkins?Neilos

2 Answers

0
votes

Files in Maven repository are versioned and have a standardized format. The format you've outlined is for SNAPSHOT revisions, explaining the time-stamp. Try setting a real number in the "version" field of the POM and you'll see the difference.

I have never used it, but I suggest trying the Maven Metadata plugin to create a drop-down list of versions, in a parametrized job.

0
votes

Do you really need two jobs? I'd rather use the Promoted Builds Plugin to deploy the artifact — this can be done based on some rule or automatically.