Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 3.6.1
    • Labels:
      None

      Description

      JDK 9 build b148 includes an important Refresh of the module system.

      This refresh includes a disruptive change that is important to understand.

      For those that have been trying out modules with regular JDK 9 builds then be aware that `requires public` changes to `requires transitive`. In addition, the binary representation of the module declaration (module-info.class) has changed so that you need to recompile any modules that were compiled with previous JDK 9 builds.

      To be able to compile the test sources, you must specify the module name (i.e -Xmodule:the.module.name). This information is already available in src/main/java/module-info.java, so no need to ask for it again. Due to the change of the binary representation the original trick wiith ASM-6.0_ALPHA doesn't work anymore.
      We're going to add a second parser based on QDox, which doesn't parse the class file but the source file. This way we have to options to extract the module name.

        Activity

        Hide
        rfscholte Robert Scholte added a comment -

        Fixed in r1778347

        Show
        rfscholte Robert Scholte added a comment - Fixed in r1778347
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build maven-plugins #8511 (See https://builds.apache.org/job/maven-plugins/8511/)
        MCOMPILER-285: Support test-compile for JDK 9 build b148+
        Introduce QDoxModuleInfoParser to have a fallback if ASM fails (rfscholte: http://svn.apache.org/viewvc/?view=rev&rev=1778347)

        • (edit) maven-compiler-plugin/pom.xml
        • (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AsmModuleInfoParser.java
        • (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/ModuleInfoParser.java
        • (add) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/ModuleInfoParser.java.bak
        • (add) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/QDoxModuleInfoParser.java
        • (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
        • (edit) maven-compiler-plugin/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-plugins #8511 (See https://builds.apache.org/job/maven-plugins/8511/ ) MCOMPILER-285 : Support test-compile for JDK 9 build b148+ Introduce QDoxModuleInfoParser to have a fallback if ASM fails (rfscholte: http://svn.apache.org/viewvc/?view=rev&rev=1778347 ) (edit) maven-compiler-plugin/pom.xml (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AsmModuleInfoParser.java (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/ModuleInfoParser.java (add) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/ModuleInfoParser.java.bak (add) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/QDoxModuleInfoParser.java (edit) maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java (edit) maven-compiler-plugin/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java
        Hide
        dmlloyd David M. Lloyd added a comment -

        Looks like -Xmodule has gone away as of April 19 (8178012). Builds of OpenJDK after this time fail in maven-compiler-plugin for test sources:

        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project jboss-modules: Fatal error compiling: invalid flag: -Xmodule:null -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project jboss-modules: Fatal error compiling
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.base/java.lang.reflect.Method.invoke(Method.java:563)
        	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
        	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:954)
        	at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:164)
        	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        	... 20 more
        Caused by: org.codehaus.plexus.compiler.CompilerException: invalid flag: -Xmodule:null
        	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:173)
        	at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
        	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:943)
        	... 23 more
        Caused by: java.lang.IllegalArgumentException: invalid flag: -Xmodule:null
        	at jdk.compiler/com.sun.tools.javac.main.Arguments.error(Arguments.java:911)
        	at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:409)
        	at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:361)
        	at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:246)
        	at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:185)
        	at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119)
        	at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68)
        	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
        	... 25 more
        [ERROR] 
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
        
        Show
        dmlloyd David M. Lloyd added a comment - Looks like -Xmodule has gone away as of April 19 (8178012). Builds of OpenJDK after this time fail in maven-compiler-plugin for test sources: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project jboss-modules: Fatal error compiling: invalid flag: -Xmodule:null -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project jboss-modules: Fatal error compiling at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:563) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:954) at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:164) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: org.codehaus.plexus.compiler.CompilerException: invalid flag: -Xmodule:null at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:173) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:943) ... 23 more Caused by: java.lang.IllegalArgumentException: invalid flag: -Xmodule:null at jdk.compiler/com.sun.tools.javac.main.Arguments.error(Arguments.java:911) at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:409) at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:361) at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:246) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:185) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119) at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125) ... 25 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
        Hide
        rfscholte Robert Scholte added a comment -

        David M. Lloyd, confirmed. See also MCOMPILER-294

        Show
        rfscholte Robert Scholte added a comment - David M. Lloyd , confirmed. See also MCOMPILER-294

          People

          • Assignee:
            rfscholte Robert Scholte
            Reporter:
            rfscholte Robert Scholte
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development