Skip to content

Commit aa0a666

Browse files
committed
[MJAVADOC-796] Do not follow links for Java 12+
This closes #287
1 parent 6488c79 commit aa0a666

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5727,13 +5727,17 @@ protected final OfflineLink getDefaultJavadocApiLink() {
57275727
}
57285728

57295729
/**
5730-
* Follows all of the given links, and returns their last redirect locations. Ordering is kept.
5731-
* This is necessary because javadoc tool doesn't follow links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)
5730+
* Follows all of the given links if the Javadoc version is before 12, and returns their last
5731+
* redirect locations. Ordering is kept. This is necessary because javadoc tool doesn't follow
5732+
* links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)
57325733
*
57335734
* @param links Links to follow.
57345735
* @return Last redirect location of all the links.
57355736
*/
57365737
private Set<String> followLinks(Set<String> links) {
5738+
if (javadocRuntimeVersion.isAtLeast("12")) {
5739+
return links;
5740+
}
57375741
Set<String> redirectLinks = new LinkedHashSet<>(links.size());
57385742
for (String link : links) {
57395743
try {

0 commit comments

Comments
 (0)