Issue Details (XML | Word | Printable)

Key: MJAVADOC-144
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Siveton
Reporter: Claes Buckwalter
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Javadoc Plugin

Cannot generate Javadoc on Mac OS X if path contains space characters

Created: 05/Sep/07 04:31 PM   Updated: 22/Dec/08 02:08 PM   Resolved: 18/Jul/08 06:55 AM
Return to search
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.5

Time Tracking:
Not Specified

Environment:
Maven version: 2.0.7
Java version: 1.5.0_07
OS name: "mac os x" version: "10.4.10" arch: "i386"
Issue Links:
Related


 Description  « Hide

Running 'mvn javadoc:javadoc' fails if the path to the current directory contains a space character. It works with the 2.0 version of the plugin. It also works if I rename the directory so that it does not contain a space character.

presley:~/Documents/workarea/Elk API clabu$ mvn -e javadoc:javadoc
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'javadoc'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building The Elk Framework
[INFO] task-segment: [javadoc:javadoc] (aggregator-style)
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing javadoc:javadoc
[INFO] ----------------------------------------------------------------------------
[INFO] Building The Elk Framework
[INFO] ----------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [javadoc:javadoc]
1 error
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - cannot read options (No such file or directory)

Command line was:"cd /Users/clabu/Documents/workarea/Elk API/target/site/apidocs && /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc" @options @packages

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - cannot read options (No such file or directory)

Command line was:"cd /Users/clabu/Documents/workarea/Elk API/target/site/apidocs && /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc" @options @packages
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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.MojoExecutionException: An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - cannot read options (No such file or directory)

Command line was:"cd /Users/clabu/Documents/workarea/Elk API/target/site/apidocs && /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc" @options @packages
at org.apache.maven.plugin.javadoc.JavadocReport.execute(JavadocReport.java:233)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.reporting.MavenReportException: Exit code: 1 - javadoc: error - cannot read options (No such file or directory)

Command line was:"cd /Users/clabu/Documents/workarea/Elk API/target/site/apidocs && /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc" @options @packages
at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(AbstractJavadocMojo.java:1407)
at org.apache.maven.plugin.javadoc.JavadocReport.generate(JavadocReport.java:131)
at org.apache.maven.plugin.javadoc.JavadocReport.execute(JavadocReport.java:219)
... 18 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Sep 05 23:28:49 CEST 2007
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------



Vincent Siveton added a comment - 10/Sep/07 07:06 AM

Could you send us the options and packages files? You need to add -Ddebug=true.
http://maven.apache.org/plugins/maven-javadoc-plugin/faq.html#How%20to%20know%20exactly%20the%20Javadoc%20command%20line


Benjamin Bentmann added a comment - 04/Oct/07 11:59 AM - edited

Caused by: org.apache.maven.reporting.MavenReportException: Exit code: 1 - javadoc: error - cannot read options (No such file or directory)

I do not believe that the options file is the trouble maker, it is not found by javadoc.

Command line was:"cd /Users/clabu/Documents/workarea/Elk API/target/site/apidocs && ..." @options @packages

To me, it seems rather like a problem with Plexus' CommandLineUtils and related classes. From MJAVADOC-127 I noticed that the shell in question for the Mac environment here might be the org.codehaus.plexus.util.cli.shell.BourneShell. Now, look at its source:

public String getExecutable()
    {
        File wd = getWorkingDirectory();

        if ( wd != null )
        {
            String path = getWorkingDirectory().getAbsolutePath();
            String exe = super.getExecutable();
            return "cd " + handleQuote( path ) + " && " + handleQuote( exe );
        }
        else
        {
            return super.getExecutable();
        }
    }

They do not seem to care about spaces in the pathes. I am not sure, but it could result in the effective command working directory "/Users/clabu/Documents/workarea/Elk", where no options or package files exist.


Tom Purcell added a comment - 29/May/08 04:03 PM

I'm having the same issue on 2 different versions of Linux (RedHat AS4 & Suse 10.2) with version 2.4 of the plugin. If I use the 2.0 version the problem does not occur.


Vincent Siveton made changes - 29/May/08 05:56 PM
Field Original Value New Value
Link This issue is related to MJAVADOC-193 [ MJAVADOC-193 ]
Vincent Siveton added a comment - 29/May/08 05:56 PM

It seems to be related to PLXUTILS-64.
I already bumped p-u to 1.5.1. Could you retry with javadoc plugin 2.5-SNAPSHOT?


Brett Porter added a comment - 01/Jun/08 08:19 AM

the changes work for me, however I now see a test failure in testQuotedPath on trunk:

-------------------------------------------------------------------------------
Test set: org.apache.maven.plugin.javadoc.JavadocReportTest
-------------------------------------------------------------------------------
Tests run: 20, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 30.902 sec <<< FAILURE!
testQuotedPath(org.apache.maven.plugin.javadoc.JavadocReportTest)  Time elapsed: 0.927 sec  <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: An error has occurred in JavaDocs report generation:Exit code: 2 - /bin/sh: -c: line 0: unexpected EOF
 while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
Command line was:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc @options @argfile
        at org.apache.maven.plugin.javadoc.JavadocReport.execute(JavadocReport.java:226)
        at org.apache.maven.plugin.javadoc.JavadocReportTest.testQuotedPath(JavadocReportTest.java:517)
Caused by: org.apache.maven.reporting.MavenReportException: Exit code: 2 - /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
Command line was:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc @options @argfile
        at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(AbstractJavadocMojo.java:1674)
        at org.apache.maven.plugin.javadoc.JavadocReport.generate(JavadocReport.java:127)
        at org.apache.maven.plugin.javadoc.JavadocReport.execute(JavadocReport.java:222)
        ... 27 more

Vincent Siveton made changes - 04/Jun/08 06:29 PM
Link This issue relates to PLXUTILS-77 [ PLXUTILS-77 ]
Vincent Siveton added a comment - 05/Jun/08 07:42 AM

I updated p-u to 1.5.2-SNAPSHOT in r663590, snapshot deployed.

Could you retry with javadoc plugin 2.5-SNAPSHOT?


Vincent Ricard added a comment - 27/Jun/08 06:39 AM

I've also the bug (linux platform, bash shell) with the 2.4 version. I just now tested the 2.5-SNAPSHOT version, and all is fine for the 'bug of the space'
Thx


Arnaud Heritier made changes - 18/Jul/08 06:55 AM
Assignee Vincent Siveton [ siveton ]
Arnaud Heritier added a comment - 18/Jul/08 06:55 AM

This issue is fixed with the update of plexus-util


Arnaud Heritier made changes - 18/Jul/08 06:55 AM
Resolution Fixed [ 1 ]
Fix Version/s 2.5 [ 14120 ]
Status Open [ 1 ] Closed [ 6 ]
Trevor Harmon added a comment - 22/Dec/08 02:08 PM

I was having the bug in Maven 2.0.9 in this configuration:

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</reporting>

Simply forcing the 2.5 version fixed the problem for me:

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</reporting>