[Updated] (MCOMPILER-339) Skip --release flag if compilerVersion is lower than 1.9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Updated] (MCOMPILER-339) Skip --release flag if compilerVersion is lower than 1.9

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MCOMPILER-339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David J. M. Karlsen updated MCOMPILER-339:
------------------------------------------
    Description:
usecase: I have a build which is jdk10 by default, declared via the parent-pom.
 However, one submodule must be compiled and run with java8. I had hoped to get this working, by setting:
{noformat}
<properties>
  <maven.compiler.release>8</maven.compiler.release>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
  <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>

{noformat}
 

but it will fail with 
{noformat}
Caused by: java.lang.IllegalArgumentException: invalid flag: --release*11:53:45*     at com.sun.tools.javac.api.JavacTool.processOptions (JavacTool.java:206)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:156)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:107)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:64)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:125)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)*11:53:45*     at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)*11:53:45*     at org.apache.maven.plugin.compiler.TestCompilerMojo.execute (TestCompilerMojo.java:176)*11:53:45*     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)*11:53:45*     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)*11:53:45*     at java.lang.Thread.run (Thread.java:748)
{noformat}

If the release flag could only be enabled for compiler versions supporting it it would be easier to juggle the build.


  was:
usecase: I have a build which is jdk10 by default, declared via the parent-pom.
However, one submodule must be compiled and run with java8. I had hoped to get this working, by setting:

{noformat}

<properties>
  <maven.compiler.release>8</maven.compiler.release>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
  <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>

{noformat}

 

but it will fail with 

{noformat}
Caused by: java.lang.IllegalArgumentException: invalid flag: --release*11:53:45*     at com.sun.tools.javac.api.JavacTool.processOptions (JavacTool.java:206)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:156)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:107)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:64)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:125)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)*11:53:45*     at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)*11:53:45*     at org.apache.maven.plugin.compiler.TestCompilerMojo.execute (TestCompilerMojo.java:176)*11:53:45*     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)*11:53:45*     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)*11:53:45*     at java.lang.Thread.run (Thread.java:748)
{noformat}


> Skip --release flag if compilerVersion is lower than 1.9
> --------------------------------------------------------
>
>                 Key: MCOMPILER-339
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-339
>             Project: Maven Compiler Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.7.0
>            Reporter: David J. M. Karlsen
>            Priority: Major
>
> usecase: I have a build which is jdk10 by default, declared via the parent-pom.
>  However, one submodule must be compiled and run with java8. I had hoped to get this working, by setting:
> {noformat}
> <properties>
>   <maven.compiler.release>8</maven.compiler.release>
>   <maven.compiler.source>1.8</maven.compiler.source>
>   <maven.compiler.target>1.8</maven.compiler.target>
>   <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
> </properties>
> {noformat}
>  
> but it will fail with 
> {noformat}
> Caused by: java.lang.IllegalArgumentException: invalid flag: --release*11:53:45*     at com.sun.tools.javac.api.JavacTool.processOptions (JavacTool.java:206)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:156)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:107)*11:53:45*     at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:64)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:125)*11:53:45*     at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)*11:53:45*     at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)*11:53:45*     at org.apache.maven.plugin.compiler.TestCompilerMojo.execute (TestCompilerMojo.java:176)*11:53:45*     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)*11:53:45*     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)*11:53:45*     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)*11:53:45*     at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)*11:53:45*     at java.util.concurrent.FutureTask.run (FutureTask.java:266)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)*11:53:45*     at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)*11:53:45*     at java.lang.Thread.run (Thread.java:748)
> {noformat}
> If the release flag could only be enabled for compiler versions supporting it it would be easier to juggle the build.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)