Search code examples
mavenjenkinsartifactory

Maven deploy current artifact in target folder as it is


For a web application we have a Jenkins pipeline with these steps:

  1. maven build of the back-end (mvn clean install)
  2. npm build of the front-end (npm run build)
  3. update the back-end .jar file including inside the front-end dist folder (jar -uf ...)
  4. deploy that jar file into our development environment (docker container on OpenShift)

This works very nicely for the deployment. The question now is how to keep these artifacts in our repository (Artifactory). If we use the mvn deploy command in step 1, the artifact we store in our repository will be the jar file without the front-end. What I would like is after step 3 make a call to maven that deploys the jar file in the /target folder as it is without modifying it.

I've seen this other question, but like this I would need to specify many things as version, groupId... what from Jenkins could be difficult and also all this information is already defined inside the pom.xml file.

Would it be possible to call maven to use the already contained configuration and just perform the upload to Artifactory step?


Solution

  • You can probably just call

    mvn deploy:deploy
    

    in the end.