I have two profiles(profile-1 & profile-2) in my pom.xml file like below. If i run a profile then the test are not executed but the build is success.
To run a profile i am using this command mvn clean test -P profile-1 , i am not sure where i am making mistake whether in pom or the way i invoke profile.
NOTE : ALL MY TEST JAVA CLASSES ARE IN src/main/java and src/test/java is simply empty.
<profiles>
<profile>
<id>profile-1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>profile-2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<executions>
<execution>
<configuration>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/IntegrationP1.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>