Hi all,

We found the cause of the problem - no memory for the fork.  We had java
processes in the background and set the compiler plugin to fork.  When
maven attempted fork it failed resulting in an error code but no error
information (at least none that the plugin could understand).

Should I log a bug on this?


FYI, I think there's an improvement we can make to the JavaCompiler code.
At present a failure with no message yields a generic error statement.
However, we do have a returnCode and could add this to the text providing a
few more bread crumbs to follow when we hit this kind of case.

        if ( ( returnCode != 0 ) && messages.isEmpty() )
        {
            if ( err.getOutput().length() == 0 )
            {
                throw new CompilerException( "Unknown error trying to
execute the external compiler: " + EOL
                    + cli.toString() );
            }
            else
            {
                messages.add( new CompilerError( "Failure executing javac,
but could not parse the error:" + EOL
                    + err.getOutput(), true ) );
            }
        }


Thanks

Peter

On Wed, Sep 19, 2012 at 3:44 PM, Peter Kahn <[email protected]> wrote:

> Hi all,
>
> How can I investigate mvn *Unknown error trying to execute the external
> compiler*? According to compiler-plugin source in this case javac returns
> nonzero but mvn can't extract error information (alas mvn appears to eat
> the javac error code in this situation)- 
> JavacCompiler.Java<http://svn.codehaus.org/plexus/plexus-components/trunk/plexus-compiler/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java>.
> I know that Mvn has issues parsing java 7 output and I tried running java
> manually but I can't reproduce the error.
>
> I'm using mvn303, compiler plugin 2.5.1 and java 1.7 07.
>
>    - mvn clean compile -X - *fails with error*
>    - copy paste mvn's failed /bin/sh for javac invocation - *sh+javac
>    completes without an error code*
>
> Let me know if you have any ideas on how to handle this situation.
>
> Thanks
>
> Peter
>
> `[ERROR] /bin/sh -c cd /myproj/modules/memory &&
> /usr/java/jdk1.7.0_07/jre/../bin/javac
> @/myproj/modules/memory/target/classes/org.codehaus.plexus.compiler.javac.JavacCompiler4013958444740287519arguments
> -J-Xmx512m -J-Xms512m [ERROR] -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
> (default-compile) on project memory: Fatal error compiling at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> ... ...
>
> org.codehaus.plexus.compiler.javac.JavacCompiler.compileOutOfProcess(JavacCompiler.java:488)
> at
> org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:157)`
>
>
> --
> Peter Kahn
> [email protected]
> http://www.google.com/profiles/citizenkahn
> Awareness - Intention - Action
>



-- 
Peter Kahn
[email protected]
http://www.google.com/profiles/citizenkahn
Awareness - Intention - Action

Reply via email to