You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Arne Degenring (JIRA)" <ji...@codehaus.org> on 2007/03/30 12:08:35 UTC

[jira] Commented: (MJAVADOC-98) Add support for Javadoc version different from JAVA_HOME

    [ http://jira.codehaus.org/browse/MJAVADOC-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_91584 ] 

Arne Degenring commented on MJAVADOC-98:
----------------------------------------

I have the same usage scenario: JAVA_HOME set to 1.4 JDK, maven-compiler-plugin configured to use 1.5 JDK). So I would also like to configure the maven-javadoc-plugin to use a different javadoc executable. I had a look at the patch and would like to suggest one improvement: It would be more convenient to not be forced to supply the full path to the executable, but instead just to the desired JDK's home directory. The configuration then could simply look like:

  <javadocHome>c:/dev/java/jdk1.5.0_06</javadocHome>

or - more portable:

  <javadocHome>${JAVA_15_HOME}</javadocHome>

The supplied javadocHome property could simply be used instead of SystemUtils.getJavaHome() where appropriate.

The main reason for my suggestion is the fact that the name of the executable is platform dependent: "javadoc.exe" on Windows or just "javadoc" on other platforms.

> Add support for Javadoc version different from JAVA_HOME
> --------------------------------------------------------
>
>                 Key: MJAVADOC-98
>                 URL: http://jira.codehaus.org/browse/MJAVADOC-98
>             Project: Maven 2.x Javadoc Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>         Environment: All
>            Reporter: Wayne Fay
>         Attachments: javadoc_version.diff, pom.xml
>
>
> Robert Brehm recently posted a question on the Maven Users list (subject "Javadoc plugin issue") about using the 1.5 Javadoc when his JAVA_HOME is set to 1.4. He is using the maven-compiler-plugin to specify the 1.5 compiler and expected the Javadoc plugin would pick that up and use it automatically, or at least offer a way to configure the Javadoc plugin directly. I got interested in the issue and wrote some code to support this functionality. 
> This is my first official foray into plugin development so I appreciate your comments etc. Also I'm still trying to figure out the plugin testing aspect so I haven't included tests with this first code drop... I'm not entirely sure how to properly develop unit tests for this because it is very environment-dependent. I did however include a sample pom.xml with the new configuration parameters -- I've tested it myself on Windows with a small app (JAVA_HOME set to 1.4 and pom.xml config pointing to 1.5) and it used the 1.5 javadoc binary as configured.
> I don't like having to include the <javadocVersion> node in the configuration but org.apache.commons.lang.SystemUtils doesn't know how to decipher the Javadoc version, only the Java version. And I was going to grab the Javac specified in maven-compiler-plugin and use it to find the Javadoc executable, then fork Javac to find the version etc, but decided that was just too much work for right now... If you want to go down that path, go for it, I'm just not sure if its worth the effort. ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira