Skip to content

Commit 05b12e8

Browse files
authored
[MJAVADOC-726] exclude velocity (#243)
* [MJAVADOC-726] exclude velocity
1 parent d1ef192 commit 05b12e8

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ under the License.
243243
<groupId>org.apache.maven.doxia</groupId>
244244
<artifactId>doxia-site-renderer</artifactId>
245245
<version>${doxia-sitetoolsVersion}</version>
246+
<exclusions>
247+
<exclusion>
248+
<!-- MJAVADOC-726 -->
249+
<groupId>org.apache.velocity</groupId>
250+
<artifactId>velocity-tools</artifactId>
251+
</exclusion>
252+
</exclusions>
246253
</dependency>
247254

248255
<!-- wagon -->

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
543543
private boolean detectOfflineLinks;
544544

545545
/**
546-
* Detect the Java API link for the current build, i.e. <code>https://docs.oracle.com/javase/1.4.2/docs/api/</code>
546+
* Detect the Java API link for the current build, e.g. <code>https://docs.oracle.com/javase/1.4.2/docs/api/</code>
547547
* for Java source 1.4.
548548
* <br/>
549549
* By default, the goal detects the Javadoc API link depending the value of the <code>source</code>
@@ -3767,7 +3767,7 @@ private Set<OfflineLink> getLinkofflines() throws MavenReportException {
37673767
* If {@code detectLinks}, try to add javadoc apidocs according Maven conventions for all dependencies given
37683768
* in the project.
37693769
* <br/>
3770-
* According the Javadoc documentation, all defined link should have <code>${link}/package-list</code> fetchable.
3770+
* According the Javadoc documentation, all defined links should have <code>${link}/package-list</code> fetchable.
37713771
* <br/>
37723772
* <b>Note</b>: when a link is not fetchable:
37733773
* <ul>
@@ -3802,7 +3802,7 @@ private void addLinkArguments(List<String> arguments) throws MavenReportExceptio
38023802
}
38033803

38043804
/**
3805-
* Coppy all resources to the output directory
3805+
* Copy all resources to the output directory.
38063806
*
38073807
* @param javadocOutputDirectory not null
38083808
* @throws MavenReportException if any
@@ -5725,14 +5725,17 @@ private Set<String> followLinks(Set<String> links) {
57255725
try {
57265726
redirectLinks.add(JavadocUtil.getRedirectUrl(new URI(link).toURL(), settings)
57275727
.toString());
5728-
} catch (Exception e) {
5728+
} catch (IOException e) {
57295729
// only print in debug, it should have been logged already in warn/error because link isn't valid
57305730
getLog().debug("Could not follow " + link + ". Reason: " + e.getMessage());
57315731

57325732
// Even when link produces error it should be kept in the set because the error might be caused by
57335733
// incomplete redirect configuration on the server side.
57345734
// This partially restores the previous behaviour before fix for MJAVADOC-427
57355735
redirectLinks.add(link);
5736+
} catch (URISyntaxException | IllegalArgumentException e) {
5737+
// only print in debug, it should have been logged already in warn/error because link isn't valid
5738+
getLog().debug("Could not follow " + link + ". Reason: " + e.getMessage());
57365739
}
57375740
}
57385741
return redirectLinks;

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ static <T> List<T> toList(T single, T[] multiple) {
12181218
return result;
12191219
}
12201220

1221-
// TODO: move to plexus-utils or use something appropriate from there
1221+
// TODO: deprecate in favor of Path.relativize
12221222
public static String toRelative(File basedir, String absolutePath) {
12231223
String relative;
12241224

@@ -1259,13 +1259,13 @@ public static boolean isEmpty(final Collection<?> collection) {
12591259
}
12601260

12611261
/**
1262-
* Execute an Http request at the given URL, follows redirects, and returns the last redirect locations. For URLs
1262+
* Execute an HTTP request to the given URL, follow redirects, and return the last redirect location. For URLs
12631263
* that aren't http/https, this does nothing and simply returns the given URL unchanged.
12641264
*
1265-
* @param url URL.
1266-
* @param settings Maven settings.
1267-
* @return Last redirect location.
1268-
* @throws IOException if there was an error during the Http request.
1265+
* @param url URL
1266+
* @param settings Maven settings
1267+
* @return final URL after all redirects have been followed
1268+
* @throws IOException if there was an error during the HTTP request
12691269
*/
12701270
protected static URL getRedirectUrl(URL url, Settings settings) throws IOException {
12711271
String protocol = url.getProtocol();

0 commit comments

Comments
 (0)