[
https://issues.apache.org/jira/browse/MJAVADOC-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852704#comment-17852704
]
Robert Važan commented on MJAVADOC-656:
---------------------------------------
[~michael-o]: Not sure I follow with the Java 12+ split. Is that about
/element-list? If you would like to fix it gradually, I am fine with that,
although I am imagining this must be a few lines of code somewhere. It should
be easier to fix that short piece of code than to introduce a new parameter.
In any case, merely disabling the redirects with a parameter wouldn't help me.
I publish javadocs for several small libraries that have root URL redirected to
the sole package to minimize number of clicks. I would have to rely on library
users to set the variable you are proposing, which they definitely wouldn't do.
Many developers don't bother to link to third party javadocs at all, because it
requires explicit configuration of javadoc URLs in every project as there's
AFAIK no way to declare javadoc URL centrally in JAR manifest or module
definition. It's too much to expect library users to tinker with redirect
parameter. I have meantime implemented a workaround for my published javadocs
by making the root redirect a soft redirect (i.e. implemented in javascript).
That makes the redirect invisible to maven.
> Following redirects breaks valid links
> --------------------------------------
>
> Key: MJAVADOC-656
> URL: https://issues.apache.org/jira/browse/MJAVADOC-656
> Project: Maven Javadoc Plugin
> Issue Type: Bug
> Affects Versions: 3.0.1, 3.2.0
> Reporter: Robert Važan
> Priority: Minor
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)