1

I am using the following versions to compile my sources to java 10:

  • maven (3.5.4)
  • maven-compiler-plugin 3.7.0
  • Java 10 (subversion 2)

with the recommended changes in pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
    <source>10</source>                                                
    <target>10</target>                                                
    <release>10</release>                                              
    <executable>javac10</executable>                                   
    <encoding>UTF-8</encoding>
</configuration>
<dependencies>                                                         
    <dependency>                                                       
        <groupId>org.ow2.asm</groupId>                                 
        <artifactId>asm</artifactId>                                   
        <version>6.1.1</version> <!-- Use newer version of ASM -->     
    </dependency>                                                      
</dependencies>

I still geht a strange error after mvn install:

        at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
    at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
    at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:244)
    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:829)
    at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete(JavacProcessingEnvironment.java:1506)
    at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
    at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1308)
    at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1139)
    at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1065)
    at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:237)
    at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:52)
    at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:992)
    at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
    at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:197)
    at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:165)
    at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
    at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
    at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:183)
    at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:165)
    at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
    at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
    at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic.getMessage(JCDiagnostic.java:771)
    at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$DiagnosticSourceUnwrapper.getMessage(ClientCodeWrapper.java:799)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:131)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
    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:564)
    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)

I really have no clue what that error means - even when I run maven with more verbose output. It seams to be a tricky problem. Is there any idea what I could do to get more information? Maybe someone already knows this error?

Thanks very much in advance.

Shannon

Stefan Zobel
  • 3,182
  • 7
  • 28
  • 38
Shannon
  • 731
  • 3
  • 12
  • 26
  • 2
    what's your java version configured for maven? what does `mvn -version` read and what command are you using? – Naman Jul 29 '18 at 14:37
  • 1
    The output is: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00) Maven home: C:\Softdev\maven\apache-maven-3.5.4\bin\.. Java version: 10, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-10 Default locale: de_AT, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" – Shannon Jul 29 '18 at 14:42
  • The configuration shared by you works for me with a similar version of maven and java on MacOS. Can you share the complete configuration and the command executed by you, to be able to reproduce the same? – Naman Jul 29 '18 at 14:55
  • First can you give the url of the project? Furthermore if you wait a few days a new version of maven-compiler-plugin will be released which should solve the issue ... – khmarbaise Jul 29 '18 at 15:59
  • Give [ASM 6.2](http://search.maven.org/#artifactdetails%7Corg.ow2.asm%7Casm%7C6.2%7Cjar) a try. – Nicolai Parlog Jul 29 '18 at 16:21
  • @Nicolai not required for java10 at least. (good to have 6.2 but not a must) – Naman Jul 29 '18 at 16:37
  • @khmarbaise a little off-topic, was there a conclusion over 3.7.1 versus 3.8.0 release of the compiler plugin, any tentative dates/mail thread you can share? – Naman Jul 29 '18 at 16:38
  • 1
    You can read about the currently running VOTE https://www.mail-archive.com/dev@maven.apache.org/msg117301.html furthermore Apart from that If everything goes well the new version should be available from Central tomorrow. The conclusion about 3.7.1 vs. 3.8.0 was simply this change https://issues.apache.org/jira/browse/MCOMPILER-335 (which requires a minor change)..apart from that dev mailing lists are open you can subscribe and read or use the archives see https://maven.apache.org/mailing-lists.html. There is nothing closed....feel free to join the list... – khmarbaise Jul 29 '18 at 17:10
  • So far the VOTE was successful. Waiting for synchronisation to central.... – khmarbaise Jul 29 '18 at 18:35
  • @khmarbaise Ya thanks for the information. Could see the vote results on the mailing list. :) – Naman Jul 29 '18 at 18:52
  • See the official announcement: https://blogs.apache.org/maven/entry/apache-maven-compiler-plugin-version or here: https://www.mail-archive.com/announce@maven.apache.org/msg00866.html – khmarbaise Jul 29 '18 at 20:57
  • i now updated to maven-compiler-plugin 3.8.0 but the error still continued. I thought that maybe it has something to do with modules and it will be necessary to add the recommended compilerArgs inside the pom.xml ` --add-modules java.xml.bind ` – Shannon Aug 02 '18 at 16:27
  • It is very important to use `maven install -proc:none` to get the "covered" compiler errors as methioned in the referenced Topic, where this approach is explained. Thanks alot! – Shannon Aug 03 '18 at 16:33
  • I had the same error log - environment is `Apache Maven 3.5.4`, `Java version: 10.0.2`, `maven-compiler-plugin: 3.7.0`. Removing the `--add-modules` from the configuration resolved that for me. – vdimitrov Aug 13 '18 at 02:20

0 Answers0