我正在尝试将 war 文件从公司的 Nexus 存储库复制到特定位置。我按以下方式使用maven-dependency-plugin :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy-to-output</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.mycompany</groupId>
<artifactId>myproduct</artifactId>
<version>2.3.0</version>
<type>war</type>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${basedir}/src/main/output</outputDirectory>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当我尝试使用<version>RELEASE</version>
而不是特定版本(或根本没有版本)以获得最新的发行版本(虽然不是最佳实践,但在这种情况下它是安全的)时,问题就出现了 - 它不起作用。有什么想法吗?
我想知道这个问题是否在 Maven 的更高版本中得到了修复;我们正在使用 3.0.3 和 maven-dependency-plugin:copy 目标正在使用<version>LATEST</version