gpt4 book ai didi

maven deploy : how to restrict to deploy only the artifacts?(多模块环境)

转载 作者:行者123 更新时间:2023-12-03 16:55:31 25 4
gpt4 key购买 nike

我有一个包含两个模块的项目:客户端和服务器。在父 pom.xml 中,我添加了部署阶段的信息,以便部署到本地目录:

<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.my</groupId>
<artifactId>myTest</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>myTest</name>
<modules>
<module>server</module>
<module>client</module>
</modules>

<!-- for: mvn deploy -->
<distributionManagement>
<repository>
<id> myRepo </id>
<url> file:myDeployDir </url>
</repository>
</distributionManagement>

</project>

当我运行 mvn deploy不仅 server-0.1.jar 和 client-0.1.jar 被复制到 myDeploy但总共有 33 个(!)文件:*pom *sha1 *md5 *xml 用于 pom、元数据和 jar。

如何设置只复制 server-0.1.jar 和 client-0.1.jar?

谢谢!

最佳答案

使用maven deploy-file

deploy:deploy-file is used to install a single artifact along with its pom. In that case the artifact information can be taken from an optionally specified pomFile, but can be completed/overriden using the command line.

关于maven deploy : how to restrict to deploy only the artifacts?(多模块环境),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14457452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com