我们的应用程序由各种在profiles.xml文件中分别定义的活动配置文件(比如A1,A2,A3,A5 ...)组成。 Maven 3预计所有的配置文件信息都将作为pom.xml文件本身的一部分进行存储。如何在Maven3中指定活动配置文件
我应如何pom.xml文件中指定的活动配置文件清单,以便我能避免在命令行中指定它们(如MVN -PA1,A2,A3,A5)
我们的应用程序由各种在profiles.xml文件中分别定义的活动配置文件(比如A1,A2,A3,A5 ...)组成。 Maven 3预计所有的配置文件信息都将作为pom.xml文件本身的一部分进行存储。如何在Maven3中指定活动配置文件
我应如何pom.xml文件中指定的活动配置文件清单,以便我能避免在命令行中指定它们(如MVN -PA1,A2,A3,A5)
应该做这它:
<profiles>
<profile>
<id>profile-1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
...
</profile>
</profiles>
从here。
@javamonkey79的答案可以使用settings.xml。有一些配置文件和激活。看看下面的例子:
<profiles>
<profile>
<id>hudson-simulate</id>
<properties>
<gituser>username</gituser>
<gitpassword>secret</gitpassword>
</properties>
</profile>
<profile>
<id>other-profile</id>
<properties>
<proerty1>username</property1>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>hudson-simulate</activeProfile>
<activeProfile>other-profile</activeProfile>
</activeProfiles>
我无法指定此为多个配置文件,我不认为该建议的作品 – user339108 2011-08-15 13:21:23