Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-394

javadoc is not found properly by default under Oracle's JDK 7+ on Mac OSX

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9.1
    • 2.10
    • None
    • None
    • Mac OSX, JDK 1.7+
    • Patch

    Description

      The logic to detect where the javadoc script is located is not correct for Oracle's JVM 1.7 and higher on Mac OSX.

      The logic inside of AbstractJavadocMojo currently special-cases all JVMs running on OSX (line 3534):

      AbstractJavadocMojo.java
              else if ( SystemUtils.IS_OS_MAC_OSX )
              {
                  javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );
              }
      

      But as of JDK 1.7 as distributed by Oracle, the default "else" block should apply here (line 3538):

      AbstractJavadocMojo.java
              else
              {
                  javadocExe =
                      new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "bin", javadocCommand );
              }
      

      The solution might be to modify line 3534 as follows (or perhaps also check for Oracle's vendor string as well--anyway, you get the idea):

      AbstractJavadocMojo.java
              else if ( SystemUtils.IS_OS_MAC_OSX && SystemUtils.JAVA_VERSION_FLOAT < 1.7f )
              {
                  javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );
              }
      

      Patch forthcoming.

      Attachments

        1. AbstractJavadocMojo.java.patch
          0.7 kB
          Laird Nelson

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              ljnelson Laird Nelson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: