Status: Resolved (View Workflow)
The current release plugin performs a build twice when a release is done. It does one build using the default build goal and then it builds again using the release goal. I am trying to override the default build goal and just perform the release goal at time of release. To do so we need to have the release goal input from the user so have added one more field in the configuration environment. Kindly see the attached image.
Thought this option is available in pre release menu but still it does not override the default build and performs two builds at time of release which take more time.
JENKINS-27875 Add ability to skip the default build step triggered by downstream build step such as Jenkins release-plugin
- is related to
JENKINS-11120 Add a possiblity to skip/override the normal build in case of a release.
We found a way to have the jenkins release-plugin to notify Jenkins core to skip the default build
1. Introduce a ‘release build step’, once it is executed and return back to Jenkins core with an instance of Environment 
2. Set the return Environment instance to null, or introduce an new flag in the environment class which notifies to override the default build.
3. Jenkins core’s Build.java ( and related concrete class ) skip the default build step base on the status of the return Env instance or the status of the new flag
This means we need help from Jenkins core dev to add new capability in Jenkins core to skip the default build step. Will file an RFE with Jenkins core
I don't exactly know what you mean but it sounds like a complicated workaround
I would also prefer to get it really fixed in a clean way instead!
@Hannes, Environment class ( see the Build Environment UI) is the handshake object between build job and jenkins core, so it makes sense to put some way to notify the core via Environment
Could you elaborate more on 'work around'?? is it from UI or from the backend? In UI, perhaps we can simplify it by just adding one more flat 'skip default build' and have the pre release step to do the maven release
@Hannes, the environment class in Jenkins core can have one more method with a return type boolean which by default always returns false. The method can be override in the release wrapper class of the release plugin. When the release wrapper class of the release plugin returns a new environment. We override the boolean method to return true if the default build needs to be override. I hope this give you some details.
The option to override the default build can be provided in the UI too.
I need this as well. The current plugin we need to insert -B release:prepare release:perform to a pre-release step, the release ended up to build twice ( run the release and run the normal job) which make to build twice longer, and it is also very hacky. Harsh's proposal fits my need, and make maven release very nature to this plugin.