Mic*_*das 2 release maven maven-release-plugin
我正在为项目中的测试使用快照依赖项
<dependency>
<groupId>com.my-company</groupId>
<artifactId>my-test-library</artifactId>
<version>LATEST</version>
<scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我知道使用的风险,LATEST但这正是我想要在测试中实现的.但是,当我使用异常调用时,此测试依赖性会阻止生成代码的释放mvn release:prepare:
[INFO] Checking dependencies and plugins for snapshots ...
There are still some remaining snapshot dependencies.
...
Caused by: org.apache.maven.shared.release.ReleaseFailureException: Can't release project due to non released dependencies :
com.my-company:my-test-library:jar:LATEST:test
in project 'My Project'
Run Code Online (Sandbox Code Playgroud)
我的dependencyManagement:
<distributionManagement>
<repository>
<uniqueVersion>true</uniqueVersion>
<id>rep-releases</id>
<name>Release Repo</name>
<url>${url}</url>
</repository>
<snapshotRepository>
<uniqueVersion>true</uniqueVersion>
<id>rep-snapshots</id>
<name>Snapshots Repo</name>
<url>${url}</url>
</snapshotRepository>
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)
为什么测试代码与发布程序有关?如何继续发布并保留依赖项?
您正在做的事情实际上是针对所有规则的,您还应首先发布测试依赖项,然后发布然后将项目版本切换到快照并将测试范围的依赖项还原到快照.
如果你真的,真的,真的必须做蠢事,那么你可以指定-DignoreSnapshots=true选项.但是,这将忽略SNAPSHOT在您pom.xml中定义的任何依赖项,这更糟糕.
你被警告了.继续冒风险,愿上帝怜悯!
| 归档时间: |
|
| 查看次数: |
1407 次 |
| 最近记录: |