Java Maven默认配置文件始终运行,即使设置了另一个配置文件?

Java Maven默认配置文件始终运行,即使设置了另一个配置文件?,java,maven,maven-surefire-plugin,Java,Maven,Maven Surefire Plugin,这是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

这是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>
*由于默认配置文件中包含的零件,ArqTest类被忽略:

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

**/*ArqTest.java

如果指定了另一个配置文件,我如何使其完全忽略默认配置文件?

尝试使用
mvn clean test-p arq jbossas remote
删除
!默认
从您的默认配置文件中,这可能就是问题所在。请查看此线程,其中他指出“一个技巧是避免默认激活activeByDefault,而是在没有属性的情况下激活配置文件”尝试使用
mvn clean test-P arq jbossas remote
删除
!默认
从您的默认配置文件中,这可能就是问题所在。请查看此线程,其中他指出“一个技巧是避免使用activeByDefault,而是在缺少属性的情况下激活配置文件”
<excludes>
    <exclude>**/*ArqTest.java</exclude>
</excludes>