user11881
user11881

Reputation: 65

Is it possible to fail a build if i try to use the same snapshot version?

Is it possible to fail a build if i try to use the same snapshot version.. Currently i have created ci/cd pipeline through Jenkins file and my requirement is, if there is already an existing snapshot version and if we are trying to build one more for the same snapshot version, then the build should fail. For example: if i have my 4.12, and if i try to create one more build for the same snapshot version it should fail. I am aware currently maven overwrites them for each build iteration. Just trying to understand if we could fail.

Upvotes: 0

Views: 427

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35805

You will probably find a way, but you should not do it.

If a version is "final" and should not be overwritten, use a release version. If you want to be able to overwrite a version, use snapshot. I see no reason why one would create a snapshot version and the forbid to overwrite it.

Upvotes: 1

Related Questions