如何使用不同的临时组 ID 进行 Maven 部署?
一些背景:
- 我已将不属于我的外部 github 存储库的 master 分支复制到个人存储库中
- 该存储库包含一个 Java 项目,并使用 Maven 进行构建和编译
- 所有中定义的组 ID pom.xml 文件是 org.mylibrary (假设)
- 部署到 Artifactory 时,部署完成到 myrepo/org/mylibrary/...
我愿意部署到:
- myrepo/org/myorganization/mylibrary
但我想避免编辑所有 pom.xml 文件,并替换包含以下内容的所有行:
和:
。
我通过 distributionManagement 元素配置部署:
<distributionManagement>
<repository>
<name>releases</name>
<id>deployment.credentials</id>
<url>https://artifactory.lab.myorg.org/artifactory/myrepo</url>
</repository>
</distributionManagement>
解决此问题的干净方法是什么?替换所有 pom.xml 文件中的 groupId 定义就可以解决问题,但是,如上所述,这是我想避免的事情。
谢谢!
Some background:
- I have copied the master branch of an external github repository, not owned by me, into a personal repository
- This repo contains a Java project and uses Maven for building and compilation
- The group ID defined in all pom.xml files is org.mylibrary (let's assume)
- When deploying to Artifactory, the deployment is done to myrepo/org/mylibrary/...
I'd like to deploy instead to:
- myrepo/org/myorganization/mylibrary
but I would like to avoid editing all the pom.xml files, and replacing all lines containing:<groupId>org.mylibrary</groupId>
with:<groupId>org.myorganization.mylibrary</groupId>
.
I'm configuring the deployment via the distributionManagement element:
<distributionManagement>
<repository>
<name>releases</name>
<id>deployment.credentials</id>
<url>https://artifactory.lab.myorg.org/artifactory/myrepo</url>
</repository>
</distributionManagement>
What's a clean way of solving this? Replacing the groupId definition in all pom.xml files does the trick, but, as said, that's something I want to avoid.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
部署到任何存储库时,Artifactory 使用 布局是为此存储库配置的。默认情况下,对于 Maven 存储库,Artifactory 使用“maven-default”布局。
我建议您首先添加您请求的布局,然后 配置您的具有新创建布局的存储库。
我希望这些信息对您有所帮助。
When deploying to any repository, Artifactory utilizes the layout that is configured for this repository. By default, for Maven repositories, Artifactory uses the "maven-default" layout.
I would recommend you to first add your requested layout and then configure your repository with the newly created layout.
I hope this information is found helpful.