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

Jake Robb edited comment on MCOMPILER-325 at 2/15/18 5:19 PM:
--------------------------------------------------------------

Here's my new output. I've updated pom.xml to specify fork=true and set the 
source and target language level to Java 8.
{code}
% mvn -version                                           
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 
2017-04-03T15:39:06-04:00)
Maven home: /Users/jrobb/bin/apache-maven-3.5.0
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"
% mvn clean test                                         
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-compiler-plugin-bug 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
maven-compiler-plugin-bug ---
[INFO] Deleting /Users/jrobb/Projects/maven-compiler-plugin-bug/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
maven-compiler-plugin-bug ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/jrobb/Projects/maven-compiler-plugin-bug/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ 
maven-compiler-plugin-bug ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
maven-compiler-plugin-bug ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/jrobb/Projects/maven-compiler-plugin-bug/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ 
maven-compiler-plugin-bug ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to 
/Users/jrobb/Projects/maven-compiler-plugin-bug/target/test-classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.485 s
[INFO] Finished at: 2018-02-15T12:17:20-05:00
[INFO] Final Memory: 9M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile 
(default-testCompile) on project maven-compiler-plugin-bug: Compilation failure 
-> [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/MojoFailureException
{code}


was (Author: jakerobb):
{code}
% mvn -version                                           
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 
2017-04-03T15:39:06-04:00)
Maven home: /Users/jrobb/bin/apache-maven-3.5.0
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"
% mvn clean test                                         
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-compiler-plugin-bug 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
maven-compiler-plugin-bug ---
[INFO] Deleting /Users/jrobb/Projects/maven-compiler-plugin-bug/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
maven-compiler-plugin-bug ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/jrobb/Projects/maven-compiler-plugin-bug/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ 
maven-compiler-plugin-bug ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
maven-compiler-plugin-bug ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/jrobb/Projects/maven-compiler-plugin-bug/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ 
maven-compiler-plugin-bug ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to 
/Users/jrobb/Projects/maven-compiler-plugin-bug/target/test-classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.485 s
[INFO] Finished at: 2018-02-15T12:17:20-05:00
[INFO] Final Memory: 9M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile 
(default-testCompile) on project maven-compiler-plugin-bug: Compilation failure 
-> [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/MojoFailureException
{code}

> StackOverflowError from javac is not reflected in output when fork=true
> -----------------------------------------------------------------------
>
>                 Key: MCOMPILER-325
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-325
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.7.0
>            Reporter: Jake Robb
>            Assignee: Robert Scholte
>            Priority: Minor
>
> Context: 
> [https://stackoverflow.com/questions/48775213/maven-compilation-error-without-any-errors-from-the-compiler]
> If the Java code being compiled contains a chain of method calls that is too 
> long to fit in javac's stack, javac will throw a StackOverflowError and exit.
> The resulting output indicates that javac errored, but does not show the SOE, 
> nor which source file caused it. (It'd be nice if it actually pointed out the 
> problem, but that's on javac, not on the Maven plugin.)
> For more recent versions of the plugin, if {{verbose=true}}, the plugin 
> output includes the files being compiled as they go, and so the last file 
> output is helpful, but it still doesn't indicate what went wrong. -X and -e 
> args to Maven are also not helpful.
> In my case, the failure occurred using default settings for stack size (I 
> think it's 1MB) when compiling a test case that chained together 673 builder 
> methods, e.g.
> {code:java}
> return new 
> MyBuilder().foo(a1).foo(a2).foo(...).foo(a672).foo(a673).build();{code}
> I assume this problem is not unique to StackOverflowErrors and would affect 
> any thrown Error from javac.
> The plugin should be updated to capture javac's error output and include it 
> when applicable.



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

Reply via email to