Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-861

Overriding excludes in profile does not achieve desired result

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.12
    • Fix Version/s: None
    • Component/s: Maven Surefire Plugin
    • Labels:
      None
    • Environment:
      Win 7 Java 6 u 30 64bit Mvn 3.0.4
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      Overriding excludes in a profile does not work, the override is simply ignored. This configuration should prevent surefire from running certain tests except when the profile run-integration-tests is set:

      <project ...>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.12</version>
      <configuration>
      <excludes>
      <exclude>**/*IntegrationTest.java</exclude>
      </excludes>
      </configuration>
      </plugin>
      </plugins>
      </pluginManagement>
      </build>

      <profiles>
      <profile>
      <id>run-integration-tests</id>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
      <excludes />
      </configuration>
      </plugin>
      </plugins>
      </pluginManagement>
      </build>
      </profile>
      </profiles>
      </project>

      As a work-around, this ugly syntax can be applied:

      <project ...>
      <profiles>
      <profile>
      <id>run-integration-tests</id>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
      <excludes>
      <exclude>NONE</exclude>
      </excludes>
      </configuration>
      </plugin>
      </plugins>
      </pluginManagement>
      </build>
      </profile>
      </profiles>
      </project>

      However, I consider this a bug.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Karsten Tinnefeld
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: