Jenkins M2 release plugin (using the maven-release-Maven plugin). If you created a Maven task (instead of Free Style), then in the Release M2 section in the task settings you will see the goals:
-Dresume=false release:prepare release:perform
If you replace it with the next release of M2, the plugin will not trigger the deployment-initiated deployment target: complete the default target.
-Dresume=false release:prepare release:perform -Darguments="-Dmaven.deploy.skip=true"
In my case, I didn’t want the artifacts to be sent to Artifactory right after the release: fulfill and release: prepare the goals were completed, so it helped. But, although Jenkins’s work has a Post Build action of both “Deploy to Artifactory” for both snapshot and repository release (depending on what type of build you have automatic / manual execution of the build job or by executing Release Maven Release ), it never caused a post-build action.
This may be good in this sense, now I can trigger the deployment using the generated release artifacts in the environment, and if the deployment / some IT tests are successful, I can upload the artifacts to Artifactory. The downside is that if your deployment depends on choosing a new artifact from Artifactory / Nexus (i.e., somewhere in the unfolding logic of the script), then you won’t be able to work until you copy the artifacts from one job to another child task.
In addition, for the purpose of maven deployment, valid / settings are required in the settings.xml or pom.xml parameters, where you specify for each of the above sections that are defined in the section that must match the value of the section defined in the .xml / pom.xml setting .
You can determine / set the value of the section for using the repository without release, which is higher in order (to resolve the artifact) than the snapshot repository, i.e. use libs-alpha-local or libs-stage-local, and then let maven deploy the target to deploy artifacts to Artifactory / Nexus.
Later, after successfully deploying in higher environments (e.g. QA / PRE, etc.), you can transfer the artifact from alpha / stage to libs-release-local.
IS_M2RELEASEBUILD The boolean variable that comes with the M2 Release plugin can be used in the conditional step to deploy here or there or not at all.