Uploaded image for project: 'Maven Compiler Plugin'
  1. Maven Compiler Plugin
  2. MCOMPILER-455

preparePaths does not take toolchain into account when parsing module-info.class

    XMLWordPrintableJSON

Details

    Description

      If you re-compile modules (e.g. via second execution of mvn compile), the CompileMojo tries to read existing module descriptors. If you used toolchains to compile those, this process will fail:

       

      Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 59.0
          at jdk.internal.module.ModuleInfo.invalidModuleDescriptor (ModuleInfo.java:1091)
          at jdk.internal.module.ModuleInfo.doRead (ModuleInfo.java:195)
          at jdk.internal.module.ModuleInfo.read (ModuleInfo.java:131)
          at java.lang.module.ModuleDescriptor.read (ModuleDescriptor.java:2487)
          at org.codehaus.plexus.languages.java.jpms.BinaryModuleInfoParser.parse (BinaryModuleInfoParser.java:35)
          at org.codehaus.plexus.languages.java.jpms.AbstractBinaryModuleInfoParser.getModuleDescriptor (AbstractBinaryModuleInfoParser.java:45)
          at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths (LocationManager.java:127)
          at org.apache.maven.plugin.compiler.CompilerMojo.preparePaths (CompilerMojo.java:238)
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:792)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
      
      

      Test project: https://github.com/torakiki/testme
      Reproduce:

      Attachments

        Activity

          People

            slachiewicz Sylwester Lachiewicz
            bmarwell Benjamin Marwell
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: