Reusing the same Maven artifact in several Jenkins / Hudson works

I installed a pipeline for a military project using Jenkins and build-pipeline-plugin . It consists of two actual assignments and a final manual assignment, which is deployed on Q & A.

Build pipeline

Each of the tasks is configured to run the same project, activating different profiles. The first task - fast - is the default build, compiling the source code, and doing unit tests. The second task - the browser - runs the browser tests based on Selenium. The third task deploys a war file on a Q & A server.

Each work creates a new war file, which bothers me for two reasons:

  • Even if only the required goals are fulfilled, for example. there are no tests when deploying to Q & A, the assembly still takes too much time, since there are many files in the WAR file.
  • We rely on the build number from Jenkins to find out what the artifact is built from. So far, this has been the number from the "fast" work, but now it is the number from the qa-deploy task.

How to configure Jenkins and / or Maven to reuse artifacts from the first job?

I would prefer a solution that does not change the overall structure of the project, since our project has a single combat module, and its separation means a lot of work to document the changes, and it is easiest to have everything in one place.

+4
source share
2 answers

I would very much like to suggest splitting this into two modules and checking integration on a military module, which may also contain a deployment action.

This is a much more flexible approach, not a big part of the effort.

+1
source

You can have one project that will create your .war, and then copy it from this project into dependent projects using the Copy Artifact plugin here .

+2
source

All Articles