我正在使用版本-maven-plugin,并在我的顶级pom.xml中为版本-maven-plugin配置了几个配置:
<build>
<pluginManagement>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<properties>
<property>
<name>magic-tool.version</name>
</property>
</properties>
</configuration>
</plugin>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
</plugin>
...
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>dependency-updates-report</report>
<report>plugin-updates-report</report>
<report>property-updates-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>也是指内部存储库“魔术工具”的属性:
<properties>
<magic-tool.version>100</magic-tool.version>有关的命令是
mvn clean && mvn versions:update-properties versions:commit -N -U -DincludeProperties=magic-tool.version -DallowSnapshots=true -X这是首选的指定确切的版本,因为它将使用在TeamCity -和这个命令完美地工作在另一个应用程序与一个几乎相同的pom.xml,和一个完全相同的配置!
但是,非功能应用程序的输出是
[DEBUG] lowerBoundArtifactVersion: 100
[DEBUG] Property ${magic-tool.version}: Current winner is: null
[INFO] Property ${magic-tool.version}: Leaving unchanged as 100当魔法工具在我们的回购系统中的v102上运行时,当我们正确工作的应用程序输出:
[DEBUG] Property ${magic-tool.version}: Set of valid available versions is [1, 2, 3, 4, 5, 6, 7... 95, 96, 97, 98, 99, 100, 101, 102]
[DEBUG] Property ${magic-tool.version}: Restricting results to null
[DEBUG] lowerBoundArtifactVersion: 101
[DEBUG] Property ${magic-tool.version}: Current winner is: 102
[DEBUG] Property ${magic-tool.version}: Searching reactor for a valid version...
[DEBUG] Property ${magic-tool.version}: Set of valid available versions from the reactor is []
[INFO] Updated ${magic-tool.version} from 100 to 102如何使非功能应用程序更新此属性魔术工具版本?
发布于 2021-02-11 17:38:36
答案是,该属性在non-functional > parent pom > dependencies中未使用,但在functional app > parent pom > dependencies中使用。
该命令是非递归的,因此它不知道属性magic-tool.version在non-functional app > child poms > dependencies中使用。
解决方案是在顶层pom中积极使用/定义依赖项中的属性(请注意,将其添加到<dependencyManagement>中没有任何作用)。
https://stackoverflow.com/questions/66159875
复制相似问题