【问题标题】:Download war file from nexus with maven使用maven从nexus下载war文件
【发布时间】:2016-07-25 11:35:23
【问题描述】:

如果我有 artifactId、groupId 和版本,我可以如何配置 pom.xml,因此 maven 将从 nexus 存储库下载 test.war 文件。 我认为这应该发生在

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            .....
            </plugin>

在执行块中。 我已经尝试过了,但没有运气:

    <execution>
    <phase>package</phase>
    <goals>
        <goal>copy</goal>
    </goals>
    <configuration>
        <artifactItems>
            <artifactItem>
                <artifactId>mytest</artifactId>
                <groupId>com.mytest</groupId>
                <version>${version}</version>
                <type>war</type>
                <destFileName>mytest-${version}.war</destFileName>
            </artifactItem>
        </artifactItems>
        <outputDirectory>${project.build.directory}</outputDirectory>
    </configuration>
</execution>

【问题讨论】:

  • 我试过了,但是没用!
  • 那么请发布您实际尝试过的内容,以便我们缩小故障排除范围,并详细说明此副本的目标是什么(涉及的其他插件/程序?)会有所帮助
  • 我更新了问题:)
  • 你复制的战争,真的是来自同一个项目吗?我的意思是,它实际上是项目正在生成的那个吗?还有,什么没用?你遇到了什么错误?

标签: maven download war nexus


【解决方案1】:

您确定${version} 的设置正确吗?如果您需要当前项目的版本,您可能应该使用&lt;version&gt;${project.version}&lt;/version&gt; 并可能设置&lt;dependencyManagement/&gt; 来为您处理。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-09
    • 1970-01-01
    • 2016-05-22
    • 2015-12-23
    • 2014-11-28
    • 1970-01-01
    • 2017-11-02
    相关资源
    最近更新 更多