英文:
How could I only deploy a specific module to my remote repository?
问题
我有一个包含多个模块的Maven项目,但我只想将其中一个模块部署到远程仓库服务器。我尝试将 distributionManagement
放在我想要部署的模块的pom文件中,但它只能放在主pom文件中。我该怎么做?
谢谢。
编辑:通过将以下内容放入我不想要部署的模块中,问题已解决:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
英文:
I have a Maven project with several modules, but I only want one to be deployed to my remote repository server. I tried to put the distributionManagement
in the pom of my module that I want to deploy, but it can only be put in the main pom. How could I do this?
Thank you.
Edit: Fixed by putting
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
to the modules that I don't want to be deployed.
答案1
得分: 0
将此模块变成一个独立的项目。从其pom文件中移除父级部分。
英文:
Make this module an independent project. Remove parent section from its pom file.
答案2
得分: 0
你可以通过将Maven部署插件的skip属性设置为true,应用于所有其他模块,来实现这一点。
但问题是:如果你后面只需要其中一个模块,为什么要使用多模块项目呢?难道不应该对它进行拆分吗?
英文:
You can do that by setting the skip property of the maven deploy plugin to true in all other modules.
But: Why is it multi-module project if you only need one of the modules later? Shouldn't it be split up?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论