1

This is the profile part of pom.xml

<profiles>
    <profile>
        <!-- The default profile skips all tests, though you can tune it 
            to run just unit tests based on a custom pattern -->
        <!-- Seperate profiles are provided for running all tests, including 
            Arquillian tests that execute in the specified container -->
        <id>default</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>!default</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>${skipTests}</skip>
                        <environment>${sv.environment}</environment>
                        <config-file>${test.config.file}</config-file>
                        <excludes>
                            <exclude>**/*ArqTest.java</exclude>
                        </excludes>                                                                             
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <profile>
        <!-- An optional Arquillian testing profile that executes tests 
            in a remote JBoss EAP instance -->
        <!-- Run with: mvn clean test -Parq-jbossas-remote -->
        <id>arq-jbossas-remote</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>false</skip>
                        <skipTests>false</skipTests>                                                        
                        <environment>${sv.environment}</environment>
                        <config-file>${test.config.file}</config-file>
                        <includes>
                            <include>**/*ArqTest.java</include>
                        </includes>                         
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jboss.shrinkwrap.resolver</groupId>
                    <artifactId>shrinkwrap-resolver-maven-plugin</artifactId>
                    <version>${version.shrinkwrap.resolver}</version>                                           
                    <executions>
                        <execution>
                            <goals>
                                <goal>propagate-execution-context</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-arquillian-container-remote</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

</profiles>

Basically, if I run maven with:

 mvn clean test -Parq-jbossas-remote

*ArqTest classes are ignored because of the part that is included in the default profile:

<excludes>
    <exclude>**/*ArqTest.java</exclude>
</excludes>    

How can I make ignore the default profile at all if another one is specified ?

Fabrizio Stellato
  • 1,727
  • 21
  • 52
  • Try using `mvn clean test -P arq-jbossas-remote` – RITZ XAVI Oct 11 '16 at 13:24
  • Remove `!default` from your default profile, this is probably the issue. – Tunaki Oct 11 '16 at 14:23
  • Please have a look at this thread where he states "One trick is to avoid activeByDefault, and instead activate the profile by the absence of a property" https://stackoverflow.com/questions/5309379/how-to-keep-maven-profiles-which-are-activebydefault-active-even-if-another-prof – felix at housecat Aug 25 '19 at 08:06

0 Answers0