如何指定要在Maven中部署的文件

编程入门 行业动态 更新时间:2024-10-24 22:18:24
本文介绍了如何指定要在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>test.nexsus/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中部署的文件

本文发布于:2023-11-05 09:29:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560471.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:要在   文件   Maven

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!