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

Following redirects breaks valid links

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.1, 3.2.0
    • None
    • None
    • None

    Description

      Version 3.0.1 fixed #427 by following redirects. This feature unfortunately breaks when HTTP server is configured as follows:

      /apidocs/package-list -> 200
      /apidocs -> 301 /apidocs/com/example/package-summary.html
      /apidocs/ -> 301 /apidocs/com/example/package-summary.html
      /apidocs/com/example/package-summary.html -> 200

      Without following redirects (in version 3.0.0), the link is passed to javadoc tool unchanged, the javadoc tool fetches /apidocs/package-list, and everything works fine. Since 3.0.1, javadoc plugin follows one of the redirects (/apidocs or /apidocs/), passes the package summary URL to javadoc tool, which then fails like this:

      [WARNING] javadoc: warning - Error fetching URL: https://example.com/apidocs/com/example/package-summary.html/

      And if you have failOnWarnings set to true, this will fail the whole build.

      The solution is fairly simple. Construct the whole URL (.../package-list) and follow redirects on that one. Then check whether the final destination ends in /package-list, strip the /package-list suffix, and pass the result to the javadoc tool.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              robert.vazan Robert Važan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: