Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1445

Properties from configuration POM are not passed to Provider on JDK 9

    XMLWordPrintableJSON

Details

    Description

      Given the POM below, the JUnitPlatformProvider can read "excludeTags" = "slow" from ProviderParameters.getProviderProperties() when it runs on JDK 8 but not on JDK 9.

      The reason is that the constructor of SurefireProperties relies on an implementation detail of the class it extends, namely that putAll() will call put() for each entry. However, while Properties does that on JDK 8, it doesn't on JDK 9.

      Here's a link to the line in SurefireProperties:
      https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java#L62

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>junit5</groupId>
          <artifactId>tagging</artifactId>
          <version>1.0-SNAPSHOT</version>
      
          <build>
              <plugins>
                  <plugin>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <version>2.19.1</version>
                      <configuration>
                          <properties>
                              <excludeTags>slow</excludeTags>
                          </properties>
                      </configuration>
                      <dependencies>
                          <dependency>
                              <groupId>org.junit.platform</groupId>
                              <artifactId>junit-platform-surefire-provider</artifactId>
                              <version>1.0.2</version>
                          </dependency>
                          <dependency>
                              <groupId>org.junit.jupiter</groupId>
                              <artifactId>junit-jupiter-engine</artifactId>
                              <version>5.0.2</version>
                          </dependency>
                      </dependencies>
                  </plugin>
              </plugins>
          </build>
      
          <dependencies>
              <dependency>
                  <groupId>org.junit.jupiter</groupId>
                  <artifactId>junit-jupiter-api</artifactId>
                  <version>5.0.2</version>
                  <scope>test</scope>
              </dependency>
          </dependencies>
      
      </project>
      

      Attachments

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              marcphilipp Marc Philipp
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: