Hi.  I have a test which takes a long time to run.  What I'd like to do is
exclude this test (written in JUnit) from the normal test phase, and only
run it when a specific profile is defined.  So, in my pom, I configure the
surefire plugin with an excludes element, which contains the exclude child
element containing the name of the Test to skip.  And, it works great.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>

<CUSTOM_HOME>${project.basedir}/src/main/config</CUSTOM_HOME>
                    </systemPropertyVariables>

<argLine>-Djava.library.path=${jniLpSolverLibPath}</argLine>
                    <excludes>
                        <exclude>**/UseCaseUnitTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

Now, I've added a profile to the POM file, which is the same as the default
setting, but instead the excluded tag is empty.  However, the test is
always excluded.  No matter how I configure the profile, it always skips
over the test because it always picks up the original excludes definition.
I've tried defining this in or out of an execution in the profile.

        <profile>
            <id>tests.allTests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes/>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

This goes against, well, every page and blog entry which tells you this
should happen.  I'm using version 2.10 of the surefire plugin on mvn
3.0.3.  Am I doing something wrong?  Or has this stopped working?  My guess
is I'm doing something not quite right, but I don't know what to do to
correct this.

Thanks for any help,
Ed

Reply via email to