0

我对Versions Maven Plugin有一个奇怪的问题。我昨天发布了我的Ueber Parent的新版本。现在我想更新其他几个使用此父级快照版本的其他 POM。

没有~/.m2/settings.xml运行mvn versions:update-parent不会将使用过的父级更新到它的最新版本。我不明白为什么?

一个示例 POM 可能如下所示:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.buschmais.jqassistant</groupId>
        <artifactId>jqa-uber-parent</artifactId>
        <version>1.2.0-RC2-SNAPSHOT</version>
    </parent>

    <repositories>
        <repository>
            <snapshots><enabled>true</enabled></snapshots>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>
</project>

疯狂的是,如果我将 Maven 中央存储库显式添加到 POM,则版本插件会找到父 POM 的最新发布版本。

<repository>
    <id>central</id>
    <url>https://repo1.maven.apache.org/maven2</url>
</repository>

有谁知道为什么?

4

0 回答 0