[英]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. 如果我尝试使用相同的快照版本,可能会导致构建失败。.目前,我已经通过Jenkins文件创建了ci / cd管道,而我的要求是,如果已经存在快照版本,并且我们正在尝试构建一个快照版本如果快照版本相同,则构建将失败。 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.
例如:如果我有4.12,并且如果我尝试为相同的快照版本创建另一个版本,则它应该失败。 I am aware currently maven overwrites them for each build iteration.
我知道当前maven在每次构建迭代时都会覆盖它们。 Just trying to understand if we could fail.
只是想了解我们是否会失败。
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.
我认为没有理由为什么要创建快照版本并禁止覆盖它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.