You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gunnar Morling (JIRA)" <ji...@apache.org> on 2018/12/10 09:07:00 UTC

[jira] [Comment Edited] (MCOMPILER-308) Compiler failure but no compiler message on the console

    [ https://issues.apache.org/jira/browse/MCOMPILER-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16714452#comment-16714452 ] 

Gunnar Morling edited comment on MCOMPILER-308 at 12/10/18 9:06 AM:
--------------------------------------------------------------------

Hi, I'm still observing this behavior with 3.8.0 and plexus-compiler-javac 2.8.5. My case might be special, though: I'm raising an exception from within a custom [javac plug-in|https://docs.oracle.com/javase/8/docs/jdk/api/javac/tree/com/sun/source/util/Plugin.html]. javac produces an output like this in that case:

{code}
Exception in thread "main" com.sun.tools.javac.util.PropagatedException: java.lang.RuntimeException: Boom
	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:217)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:285)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
Caused by: java.lang.RuntimeException: Boom
	at com.example.MyPlugin.init(MyPlugin.java:21)
	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:215)
	... 4 more
{code}

This is not handled by Plexus's {{JavacCompiler}}, so the output is swallowed.

I'm using Java 11.0.1:

{code}
java --version
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
{code}


was (Author: gunnar.morling):
Hi, I'm still observing this behavior with 3.8.0 and plexus-compiler-javac 2.8.5. My case might be special, though: I'm raising an exception from within a custom [javac plug-in|https://docs.oracle.com/javase/8/docs/jdk/api/javac/tree/com/sun/source/util/Plugin.html]. javac produces an output like this in that case:

{code}
Exception in thread "main" com.sun.tools.javac.util.PropagatedException: java.lang.RuntimeException: Boom
	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:217)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:285)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
Caused by: java.lang.RuntimeException: Boom
	at com.example.MyPlugin.init(MyPlugin.java:21)
	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:215)
	... 4 more
{code}

This is not handled by Plexus's {{JavacCompiler}}, so the output is swallowed.

> Compiler failure but no compiler message on the console
> -------------------------------------------------------
>
>                 Key: MCOMPILER-308
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-308
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.7.0
>            Reporter: Gary Gregory
>            Priority: Major
>
> Using:
> Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T13:39:06-06:00)
> Maven home: C:\Java\apache-maven-3.5.0\bin\..
> Java version: 9, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk-9
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
> java version "9"
> Java(TM) SE Runtime Environment (build 9+181)
> Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
> Steps to reproduce:
> * git clone https://git-wip-us.apache.org/repos/asf/logging-log4j2.git
> * git checkout tags/log4j-2.9.1-rc1
> * mvn -e verify
> Will give you:
> {noformat}
> [INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ log4j-core ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 530 source files to C:\temp\rc\apache-log4j-2.9.1-src\log4j-core\target\test-classes
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache Log4j 2 ..................................... SUCCESS [  3.890 s]
> [INFO] Apache Log4j API Java 9 support .................... SUCCESS [  8.330 s]
> [INFO] Apache Log4j API ................................... SUCCESS [ 37.451 s]
> [INFO] Apache Log4j Core .................................. FAILURE [ 55.364 s]
> [INFO] Apache Log4j Core Integration Tests ................ SKIPPED
> [INFO] Apache Log4j 1.x Compatibility API ................. SKIPPED
> [INFO] Apache Log4j SLF4J Binding ......................... SKIPPED
> [INFO] Apache Log4j to SLF4J Adapter ...................... SKIPPED
> [INFO] Apache Log4j Commons Logging Bridge ................ SKIPPED
> [INFO] Apache Log4j Flume Bridge .......................... SKIPPED
> [INFO] Apache Log4j Web ................................... SKIPPED
> [INFO] Apache Log4j Tag Library ........................... SKIPPED
> [INFO] Apache Log4j JMX GUI ............................... SKIPPED
> [INFO] Apache Log4j Samples ............................... SKIPPED
> [INFO] Apache Log4j Samples: Flume - Common ............... SKIPPED
> [INFO] Apache Log4j Samples: Flume - Remote ............... SKIPPED
> [INFO] Apache Log4j Samples: Flume - Embedded ............. SKIPPED
> [INFO] Apache Log4j Samples: Configuration ................ SKIPPED
> [INFO] Apache Log4j Samples: LoggerProperties ............. SKIPPED
> [INFO] Apache Log4j OSGi .................................. SKIPPED
> [INFO] Apache Log4j BOM ................................... SKIPPED
> [INFO] Apache Log4j NoSQL ................................. SKIPPED
> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 01:47 min
> [INFO] Finished at: 2017-09-18T10:00:51-06:00
> [INFO] Final Memory: 41M/137M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile (default-testCompile) on project log4j-core: Compilation failure -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile (default-testCompile) on project log4j-core: Compilation failure
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
>         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:51)
>         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
>         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
>         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
>         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)
> Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
>         at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1165)
>         at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176)
>         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
>         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
>         ... 20 more
> [ERROR]
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> {noformat}
> But what is the compile error?



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