[ 
https://jira.codehaus.org/browse/MCOMPILER-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=274776#comment-274776
 ] 

David Biesack commented on MCOMPILER-22:
----------------------------------------

On a slightly related note, our javac builds in Maven (using v 2.3.2 of the 
compiler plugin) was failing
with a similar error


  [INFO] Compilation failure
  error: error reading 
/u/sasdjb/.m2/repository/com/sas/commons/lang/sas.commons.lang/1.1-SNAPSHOT/sas.commons.lang-1.1-SNAPSHOT.jar;
 line too long

It was unrelated to this old and fixed problem, but I want to add a note here 
since a web search for
my problem lead me here, and there were no other hints. So this may help others 
who search for
"compilation failure" and "error reading" and "line too long"

My problem turned out to be due to a bad (manual) MANIFEST.MF created in a 
dependent jar's maven build.
(we require specific manifest entries not created by default)
I fixed the MANIFEST.MF generation and rebuilt it, and this solved the javac 
error. javac was not
complaining about the command line being too long, but about a line in the 
MANIFEST.MF file in the jar
being too long -- although it does not say that.



> Compilation fails: "The command line is too long."
> --------------------------------------------------
>
>                 Key: MCOMPILER-22
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-22
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.0.1
>            Reporter: Matthew Beermann
>            Assignee: Carlos Sanchez
>            Priority: Critical
>             Fix For: 2.0.2
>
>         Attachments: maven-compiler-plugin.patch, 
> maven-compiler-plugin-space-fix.patch, MCOMPILER-22.patch, 
> MNG-MCCOMPILER-22-maven-compiler-plugin.patch, 
> MNG-MCCOMPILER-22-plexus-compilers-noformatting.patch, 
> MNG-MCCOMPILER-22-plexus-compilers.patch, plexus-compiler-javac-1.5.2.jar, 
> plexus-compiler-javac.patch
>
>
> For one of my project, compilation fails with the message "The command line 
> is too long". As far as I can tell, it's listing each and every source file, 
> one at a time, in the -sourcepath attribute. (?!?) Here's the log:
> [DEBUG] Source roots:
> [DEBUG]  C:\continuum-1.0.2\apps\continuum\working-directory\26\src
> [DEBUG] Command line options:
> [DEBUG] -d 
> C:\continuum-1.0.2\apps\continuum\working-directory\26\target\classes 
> -classpath <DEPENDENCIES SNIPPED HERE> -sourcepath <ENORMOUSLY LONG LIST OF 
> SOURCE FILES HERE> -g -nowarn -target 1.4 -source 1.4
> Compiling 167 source files to 
> C:\continuum-1.0.2\apps\continuum\working-directory\26\target\classes
> [INFO] 
> ----------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Compilation failure
> Failure executing javac,  but could not parse the error:
> The command line is too long.
> [INFO] 
> ----------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.BuildFailureException: Compilation failure
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:551)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>       at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation 
> failure
>       at 
> org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:429)
>       at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:110)
>       at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
>       ... 16 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to