如何指定要在Maven中部署的文件 [英] How to specify files to be deployed in Maven

查看:162
本文介绍了如何指定要在Maven中部署的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pom文件的包装是pom.

My pom file's packaging is pom.

我想将生成的jar和pom文件上传到如下所示的存储库中.

I would like to upload generated jar and pom files to repository like below.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.7</version>
            <executions>
                <execution>
                    <id>default-cli</id>
                    <phase>package</phase>
                    <goals>
                        <goal>deploy-file</goal>
                    </goals>
                    <configuration>
                        <file>target/${artifactId}-${version}.jar</file>
                        <repositoryId>SERVER-Snapshots</repositoryId>
                        <url>https://test.nexsus.com/content/repositories/snapshots/</url>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我收到以下错误消息.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project xxx: The artifact information is inco
mplete or not valid:
[ERROR] [0]  'groupId' is missing.
[ERROR] [1]  'artifactId' is missing.
[ERROR] [2]  'version' is missing.
[ERROR] -> [Help 1]

也可以用jar包装pom部署文件,例如jar,sha1,md5,pom和zip.如何排除其中一些?

Also jar packaging pom deploy files such as jar, sha1, md5, pom and zip. How can I exclude some of them?

推荐答案

您不能使用pom中的deploy:deploy-file.要部署其他文件,请使用构建助手将它们作为其他工件附加到当前项目.

You can't use deploy:deploy-file from a pom. To deploy additional files, use the build helper to attach them to the current project as additional artifacts.

这篇关于如何指定要在Maven中部署的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆