Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-28

{@link foo} doesn't work when "foo" is a package name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Labels:
      None
    • Environment:
      Windows XP
    • Number of attachments :
      2

      Description

      See or link tags of the kind

      {@link org.mypackage}

      doesn't work with maven-javadoc-plugin (we get a "Tag @link: reference not found: org.mypackage" warning), while it work when using the javadoc tool from the command line or from an Ant script. I suspect that this is related to the way maven-javadoc-plugin work, which provides a list of source files as a @files argument.

      A possible workaround is to provide a way to use the maven-javadoc-plugin through the javadoc's -subpackages option, instead of letting maven-javadoc-plugin creates a @files. It would gives more control to the user, would allows the current <excludePackageNames> parameter to work (this parameter is currently useless since it is ignored when the files to process are provided in @files), and would solve the problem reported in this JIRA issue.

        Activity

        Hide
        Maria Odea Ching added a comment -

        Cannot reproduce error. When javadoc was executed, there were no warnings for the

        {@link...}

        tags in the javadoc comments of the test project. The links were also present in the generated javadocs.

        Show
        Maria Odea Ching added a comment - Cannot reproduce error. When javadoc was executed, there were no warnings for the {@link...} tags in the javadoc comments of the test project. The links were also present in the generated javadocs.
        Hide
        Martin Desruisseaux added a comment -

        Thanks for looking at this issue. I attached a test case (test.zip file).

        Environment tested:

        • Maven 2.0.2
        • maven-javadoc-plugin 2.0-beta-3
        • Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
        • Windows XP

        Steps to reproduce:

        • unzip test.zip
        • cd test
        • mvn compile
        • mvn javadoc:javadoc

        Note that {{mvn javadoc:javadoc produced a warning. Open the target/javadoc/index.html file. In the "All classes" section, click on "App". We can see that org.dummy.test in the class description is not an hyperlink.

        Steps to compare with Sun's javadoc:

        • javadoc -sourcepath src\main\java -classpath target\classes -d target\compare -subpackages org

        Open the target/compare/index.html file. In the "All classes" section, click on "App". We can see that org.dummy.test in the class description is an hyperlink as expected.

        Show
        Martin Desruisseaux added a comment - Thanks for looking at this issue. I attached a test case ( test.zip file). Environment tested: Maven 2.0.2 maven-javadoc-plugin 2.0-beta-3 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Windows XP Steps to reproduce: unzip test.zip cd test mvn compile mvn javadoc:javadoc Note that {{ mvn javadoc:javadoc produced a warning. Open the target/javadoc/index.html file. In the "All classes" section, click on "App". We can see that org.dummy.test in the class description is not an hyperlink. Steps to compare with Sun's javadoc: javadoc -sourcepath src\main\java -classpath target\classes -d target\compare -subpackages org Open the target/compare/index.html file. In the "All classes" section, click on "App". We can see that org.dummy.test in the class description is an hyperlink as expected.
        Hide
        Maria Odea Ching added a comment -

        Attached patch file that fixes this issue.
        The patch already accepts "sourcepath" and "subpackages" as parameters.
        If there are no "subpackages" defined, the plugin still uses the @files.

        Show
        Maria Odea Ching added a comment - Attached patch file that fixes this issue. The patch already accepts "sourcepath" and "subpackages" as parameters. If there are no "subpackages" defined, the plugin still uses the @files.
        Hide
        Allan Ramirez added a comment -

        applied patch. thanks

        Show
        Allan Ramirez added a comment - applied patch. thanks

          People

          • Assignee:
            Maria Odea Ching
            Reporter:
            Martin Desruisseaux
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 10 hours, 30 minutes
              10h 30m