Maven 版本插件:versions:use-releases 什么都不做

Maven Versions Plugin: versions:use-releases does nothing

我需要在发布之前更改项目的所有快照依赖项。我正在从命令行 mvn versions:use-releases 尝试 versions:use-releases,但它对我不起作用.我正在使用 Nexus 存储库进行发布,发布版本已正确部署并具有 public 访问权限

<dependencyManagement>  
 <dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.efx.util</groupId>
      <artifactId>efx-util</artifactId> 
      <version>0.0.1-SNAPSHOT</version>
    </dependency>
  </dependencies>
</dependencyManagement>

当我执行:mvn versions:use-releases 时,它什么都不做。

[INFO] ------------------------------------------------------------------------
[INFO] Building efx-clientesocket 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:use-releases (default-cli) @ efx-clientesocket ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building efx-clientesocket-api 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:use-releases (default-cli) @ efx-clientesocket-api ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building efx-clientesocket-impl 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:use-releases (default-cli) @ efx-clientesocket-impl ---
[INFO] Ignoring reactor dependency: com.efx.clientesocket:efx-clientesocket-api:jar:0.0.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building efx-clientesocket-conf 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:use-releases (default-cli) @ efx-clientesocket-conf ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] efx-clientesocket .................................. SUCCESS [  1.539 s]
[INFO] efx-clientesocket-api .............................. SUCCESS [  0.031 s]
[INFO] efx-clientesocket-impl ............................. SUCCESS [  0.016 s]
[INFO] efx-clientesocket-conf ............................. SUCCESS [  0.015 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

但是versions:display-dependency-updates 检测到相应的版本

 ------------------------------------------------------------------------
[INFO] Building efx-clientesocket-conf 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:display-dependency-updates (default-cli) @ efx-clientesocket-conf ---
[INFO] artifact junit:junit: checking for updates from nexus
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO]   com.efx.util:efx-util ................ 0.0.1-SNAPSHOT -> 1.0.0-RELEASE
[INFO]   junit:junit ............................................. 4.11 -> 4.12
[INFO]
[INFO] ------------------------------------------------------------------------

我也在尝试 versions:use-last-releases 作为替代方案,一切顺利。在这种情况下,我使用 -Dincludes= 来避免更新无快照版本。但是,我想使用 versions:use-releases 来确保一次只更新 属性 中的所有快照版本和覆盖版本

我使用的Maven版本是3.3.1插件版本是2.2

有人知道为什么不工作吗?

1- versions:use-releases 在 pom 中搜索所有已发布的 -SNAPSHOT 版本,并用相应的发布版本替换它们。

com.efx.util:efx-util ................ 0.0.1-SNAPSHOT -> 1.0.0-RELEASE 

这意味着efx-util-0.0.1-SNAPSHOT应该有相应的Release efx-util-0.0.1-RELEASEefx-util-0.0.1(0.0.1的发布版本)否则将无法使用。 1.0.0-RELEASE 不是相应的版本

2- versions:use-latest-releases 在 pom 中搜索所有较新版本的非 SNAPSHOT 版本,并将它们替换为最新版本。

在这种情况下,它不限于(0.0.1-SNAPSHOT)的相应版本。因此该版本可能具有不同的版本号 (1.0.0-RELEASE)。

希望这对您有所帮助。