1);profile可以构建不同的环境,让开发,产品环境给以管理。
2):pom.xml中的profiles元素,它包含了一个或者多个profile元素。由于profile覆盖了pom.xml中的默认设置,profiles通常是pom.xml中的最后一个元素。例如:
<profiles>
<profile>
<id>production</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<debug>false</debug>
<optimize>true</optimize>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles
每个每个profile必须要有一个id元素,mvn clean install -Pproduction 可以通过该命令调用。profile几乎可以覆盖pom.xml的所有元素。
2.用Profile激活动态包含子模块: