0

我有一个多模块项目。所有的模块,但一个是不同的。文件中有一些东西settings.xml我希望在一个模块中与其他模块不同。

是否可以有两个settings.xml文件并将它们用于不同的模块?

4

2 回答 2

2

Think of the settings.xml as the configuration for your installation of maven. It determines the behavior of maven across it's use in your various projects.

This being said, if an individual project, i.e. a pom, requires something unique, it should be in that pom.

I think the thing to remember is that the project should be able to build on an individual dev's machine without any special intervention. In other words, the ideal case is that a given pom can successufl execute mvn install in a vanilla environment. So, don't put something in it that requires tweaking for a dev to get it to work. Also don't put anything in your settings.xml that enables a project to build, but then puts the burden on other devs to know what secrets are in your settings.xml.

于 2013-02-01T19:39:01.020 回答
0

您可以在各个 pom 文件中设置不同的内容。pom 文件中的内容将覆盖设置中的内容。例如,如果您的子 poms 设置不同的存储库,它们将用于 settings.xml 中定义的内容。Settings.xml 是默认值,没有其他适用。根据您想要做什么,您还可以查看配置文件功能。

于 2013-02-01T19:33:31.573 回答