-1

Fatal error compiling: Unrecognized option : java.datatransfer -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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

Am getting above error while limiting java modules. Can anyone plz help me into this. below is the section where I have limited module.

     <plugin>
       <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-compiler-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <compilerArgument>--warn:none</compilerArgument>
          <compilerArgument>--err:none</compilerArgument>
          <compilerArgument>-warn:+discouraged,forbidden</compilerArgument>
          <compilerArgs>--limit-modules,java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.se,java.security.jgss,java.security.sasl,java.smartcardiojava.sql,java.sql.rowset,java.transaction.xa,java.xml.crypto,jdk.accessibility,jdk.attach,jdk.charsets,jdk.compiler,jdk.crypto.cryptoki,jdk.crypto.ec</compilerArgs>                   
          <useProjectSettings>true</useProjectSettings>
          </configuration>
          </plugin>





I'm not able to limit the module.
Asawari
  • 11
  • 3

1 Answers1

0

The list for --limit-modules is a separate argument.

Mixing compilerArgument and compilerArgs does not work properly, compilerArgs is overring the compilerArgument entries which are being ignored (you can tell this because --warn:none and --err:none are not actually valid).

So use:

 <compilerArgs>
   <arg>-warn:none</arg>
   <arg>-err:none</arg>
   <arg>-warn:+discouraged,forbidden</arg>
   <arg>--limit-modules</arg>
   <arg>java.base,java.compiler ... rest of modules ...</arg>
</compilerArgs>
greg-449
  • 109,219
  • 232
  • 102
  • 145