Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7127

NullPointerException in MavenCliTest.testStyleColors in JDK 16

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 3.8.2, 4.0.0-alpha-2, 4.0.0

    Description

      Given

      That I'm using JDK 16 to build https://github.com/apache/maven

      When

      Executing the command to build the project locally after the git clone

      mvn clean verify
      

      Then

      There is a failed test

      [ERROR] Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.929 s <<< FAILURE! - in org.apache.maven.cli.MavenCliTest
      [ERROR] testStyleColors  Time elapsed: 0.03 s  <<< ERROR!
      java.lang.NullPointerException
      	at org.apache.maven.cli.MavenCliTest.testStyleColors(MavenCliTest.java:327)
      

      Possible cause:

      In JDK 8 the method Paths.get used in ResolveFile.java#L47 is using internally:

      public static Path get(String first, String... more) {
          return FileSystems.getDefault().getPath(first, more);
      }
      

      but in JDK 16

      public static Path get(String first, String... more) {
          return Path.of(first, more);
      }
      

      Attachments

        Issue Links

          Activity

            People

              martinkanters Martin Kanters
              cchacin Carlos Chacin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: