- <Context docBase="D:\IdeaProjects\Test\example\example-web\target\example- web" reloadable="false" path=""/>
- <repositories>
- <pluginRepositories>
- <dependencies>
- <plugins>
- <properties> (not actually available in the main POM, but used behind the scenes)
- <modules>
- <reporting>
- <dependencyManagement>
- <distributionManagement>
- a subset of the <build> element, which consists of:
- <defaultGoal>
- <resources>
- <testResources>
- <finalName>
- mvn groupId:artifactId:goal -P profileId-1,profileId-2
- <settings>
- ...
- <profiles>
- <profile>
- <id>profile1</id>
- ...
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>profile-1</activeProfile>
- </activeProfiles>
- ...
- </settings>
- <profiles>
- <profile>
- <activation>
- <jdk>1.4</jdk>
- </activation>
- ...
- </profile>
- </profiles>
- <profiles>
- <profile>
- <activation>
- <property>
- <name>debug</name>
- </property>
- </activation>
- ...
- </profile>
- </profiles>
- mvn groupId:artifactId:goal –Ddebug
- <profiles>
- <profile>
- <activation>
- <property>
- <name>environment</name>
- <value>test</value>
- </property>
- </activation>
- ...
- </profile>
- </profiles>
- mvn groupId:artifactId:goal -Denvironment=test
- <profiles>
- <profile>
- <activation>
- <os>
- <name>Windows XP</name>
- <family>Windows</family>
- <arch>x86</arch>
- <version>5.1.2600</version>
- </os>
- </activation>
- ...
- </profile>
- </profiles>
- <profiles>
- <profile>
- <activation>
- <file>
- <missing>target/generated-sources/axistools/wsdl2java/org/apache/maven</missing>
- </file>
- </activation>
- ...
- </profile>
- </profiles>
- <project>
- ...
- <build>
- <plugins>
- <plugin>
- <groupId>org.myco.plugins</groupId>
- <artifactId>spiffy-integrationTest-plugin</artifactId>
- <version>1.0</version>
- <configuration>
- <appserverHome>${appserver.home}</appserverHome>
- </configuration>
- </plugin>
- ...
- </plugins>
- </build>
- ...
- </project>
- <settings>
- ...
- <profiles>
- <profile>
- <id>appserverConfig</id>
- <properties>
- <appserver.home>/path/to/appserver</appserver.home>
- </properties>
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>appserverConfig</activeProfile>
- </activeProfiles>
- ...
- </settings>
- <project>
- ...
- <profiles>
- <profile>
- <id>appserverConfig-dev</id>
- <activation>
- <property>
- <name>env</name>
- <value>dev</value>
- </property>
- </activation>
- <properties>
- <appserver.home>/path/to/dev/appserver</appserver.home>
- </properties>
- </profile>
- <profile>
- <id>appserverConfig-dev-2</id>
- <activation>
- <property>
- <name>env</name>
- <value>dev-2</value>
- </property>
- </activation>
- <properties>
- <appserver.home>/path/to/dev/appserver2</appserver.home>
- </properties>
- </profile>
- </profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.myco.plugins</groupId>
- <artifactId>spiffy-integrationTest-plugin</artifactId>
- <version>1.0</version>
- <configuration>
- <appserverHome>${appserver.home}</appserverHome>
- </configuration>
- </plugin>
- ...
- </plugins>
- </build>
- ...
- </project>
- mvn -Denv=dev-2 integration-test
- mvn -Denv=dev integration-test
- mvn -Denv=production integration-test
- mvn help:active-profiles
- mvn help:active-profiles -Denv=dev
- The following profiles are active:
- - appserverConfig-dev (source: pom)
- mvn help:active-profiles
- The following profiles are active:
- - appserverConfig (source: settings.xml)
- mvn help:active-profiles -P appserverConfig-dev
- The following profiles are active:
- - appserverConfig-dev (source: pom)
- - appserverConfig (source: settings.xml)