bmarwell commented on a change in pull request #77:
URL:
https://github.com/apache/maven-javadoc-plugin/pull/77#discussion_r635532238
##########
File path:
src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -6677,6 +6682,11 @@ protected boolean isValidJavadocLink( String link,
boolean detecting )
elementListUri = new File( dir, ELEMENT_LIST ).toURI();
}
+ if ( isOffline && !trimmedLowercaseLink.startsWith( "file:" ) )
+ {
+ // checking of both elementlists and package lists skipped.
+ return false;
Review comment:
Well, a quick interim solution could be sth like this:
```diff
Index:
src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git
a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
---
a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
(revision 92957646c0be81474fcbf1e84032880f2e2b350e)
+++
b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
(date 1621452882333)
@@ -4368,7 +4368,7 @@
continue;
}
- if ( isOffline && !link.startsWith( "file:" ) )
+ if ( isOffline && isOnlineLink( link ))
{
continue;
}
@@ -4382,6 +4382,19 @@
}
}
+ private boolean isOnlineLink( String link ) {
+ if ( link.startsWith( "file:" ) ) {
+ return true;
+ }
+
+ if ( link.startsWith( "http" ) &&
+ (link.contains( "//localhost" ) || link.contains( "//127.0.0."
) ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
/**
* Coppy all resources to the output directory
*
@@ -6726,7 +6739,7 @@
elementListUri = new File( dir, ELEMENT_LIST ).toURI();
}
- if ( isOffline && !trimmedLowercaseLink.startsWith( "file:" ) )
+ if ( isOffline && isOnlineLink( trimmedLowercaseLink ))
{
// checking of both elementlists and package lists skipped.
return false;
```
But I fear such provisional changes, as nothings holds as forever as
provisionally solutions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]