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

Unable to test Multi Release Jar with surefire or failsafe

    XMLWordPrintableJSON

Details

    Description

      I'm creating a Multi Release jar, containing base Java 1.8 and Java 11 classes. But am not able to successful test the Java 11 part.

      In the following repo, I've got 3 tests.

      • 1 test needs to be executed using Java 1.8 that are under src/test/java.
      • 2 tests need to be executed using Java 11 that are under src/test/java11.

      If the src/test/java tests are executed using Java 11 I expect it to fail which is expected, because it would be picking up the classes under target/classes/META-INF/versions/11/ and not the Java 1.8 version under target/classes/. Because the tests have been written to prove the correct source file is used for execution so the Java 1.8 BaseClass returns a different string to the Java 11 BaseClass.

      https://github.com/nhojpatrick/issue-maven-multi-release-jar-testing

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nhoj.patrick John Patrick
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: