发布项目时,测试范围内可以有快照版本吗?
我正在尝试发布一个在测试范围内具有依赖项的项目。 该依赖项仍处于 SNAPSHOT 版本中。当我尝试发布 Maven 发布插件时,会抛出一个错误,指出必须将快照更改为发布版本。
有什么想法,为什么测试范围内的某些东西会发生这种情况?
<dependency>
<groupId>com.xxx.yyy.zzz.utils</groupId>
<artifactId>benchmark</artifactId>
<version>1.13-SNAPSHOT</version>
<scope>test</scope>
</dependency>
错误:
[INFO] Can't release project due to non released dependencies :
com.xxx.yyy.zzz.utils:benchmark:jar:1.13-SNAPSHOT:test
in project 'Some Core' (com.xxx.yyy.zzz.Some:Some-core:jar:1.13-SNAPSHOT)
Im trying to release a project which has a dependency in the test scope.
The dependency is still in SNAPSHOT version. While I'm trying to release the maven release plugin throws an error saying the SNAPSHOT has to be changed to release version.
Any ideas, why this would happen for something in the test scope?
<dependency>
<groupId>com.xxx.yyy.zzz.utils</groupId>
<artifactId>benchmark</artifactId>
<version>1.13-SNAPSHOT</version>
<scope>test</scope>
</dependency>
Error:
[INFO] Can't release project due to non released dependencies :
com.xxx.yyy.zzz.utils:benchmark:jar:1.13-SNAPSHOT:test
in project 'Some Core' (com.xxx.yyy.zzz.Some:Some-core:jar:1.13-SNAPSHOT)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不太好。
如果您这样做,则意味着您的版本的测试可能不稳定;也就是说,如果有人发布了您所依赖的快照的错误版本,它们可能会崩溃。想要为自己构建工件的下游人可能会认为这是一件坏事。如果您需要在几个月内创建紧急补丁版本,这对您来说是一件坏事。
说服拥有您所依赖的工件的人为您创建发布版本……或者克隆它并自己完成。
Not really.
If you do this, it means that the tests for your release are potentially unstable; i.e. they might break if someone releases a bad version of the snapshot you depend on. Downstream people who want to build your artifacts for themselves would probably consider this to be a bad thing. And it is a bad thing for you if you need to create a emergency patch release in a few months time.
Convince whoever owns the artifact you depend on to create a release version for you ... or clone it and do it yourself.