Another question is Maven. I have a TestNG test application running maven-surefire-plugin. I created 2 profiles, for pdoruction and for testing.
I create my application with the command "mvn clean install". Now my goal is to run TestNG tests only when I specify a test profile.
The code:
profiles> <profile> <id>prod</id> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>test</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <suiteXmlFiles> <suiteXmlFile>${basedir}/target/test-classes/firstTest.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build> </profile> </profiles>
But the problem is that the tests run every time I create my application ... regardless of whether the "test" profile is specified or not. Why?
java maven
G.Spansky Dec 17 '15 at 12:09 2015-12-17 12:09
source share