I am looking to set up release jobs in Jenkins. We use Jenkins, Maven 3 and Perforce for source control and Nexus for repository management.
I have set up jobs with maven goals release:prepare and release:perform, however I notice that build times are doubled as both compilation and testing happens twice. My current understanding of the maven-release-plugin prepare and perform goals are as follows:
maven-release-plugin prepare:
clean verify
to ensure code can be compiled and passes tests.Also, a release.properties file is created with VCS tag and release and development version information
maven-release-plugin perform
deploy
/ deploy-site
depending on whether the project has a distributionManagementSo in order to stop doubling the build time as well as preserve build integrity, I am thinking of doing the following:
clean deploy
release:prepare
With the above, I think I can merge the two (prepare
and perform
) into one step and save on build turn around time. We generally always build with one build environment to target one stack (Java 6, etc) and so as long as the code successfully compiles and passes tests in the preparation step, then it is fine to deploy the artifacts to Nexus.
I am mainly looking for opposing thoughts where the above can go wrong so that I can be saved from what my eyes are blind to.
Thanks
This is a maven question not a Jenkins one.
In maven the prepare and perform operations do 2 different things. One operate on snapshots, the other in the tagged version of your release. One is deployed to your snapshotRepository the other to your release repository. One creates your next snapshot build, one creates your current release.
They serve different purposes. And both may be failing in their own ways depending on your maven & repository configs. Hence the need to run them both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With