Skip to content

Commit 75575cd

Browse files
authored
Use Java 7 relativization instead of hand-rolled code (#385)
* Use JDK 7 relativization instead of hand-rolled code
1 parent e2cf9d2 commit 75575cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
import static org.apache.maven.plugins.javadoc.JavadocUtil.isEmpty;
143143
import static org.apache.maven.plugins.javadoc.JavadocUtil.isNotEmpty;
144144
import static org.apache.maven.plugins.javadoc.JavadocUtil.toList;
145-
import static org.apache.maven.plugins.javadoc.JavadocUtil.toRelative;
146145

147146
/**
148147
* Base class with the majority of Javadoc functionality.
@@ -5876,8 +5875,10 @@ protected final JavadocOptions buildJavadocOptions() throws IOException {
58765875
options.setTags(toList(tags));
58775876

58785877
if (getProject() != null && getJavadocDirectory() != null) {
5879-
options.setJavadocResourcesDirectory(
5880-
toRelative(getProject().getBasedir(), getJavadocDirectory().getAbsolutePath()));
5878+
Path basedir = getProject().getBasedir().toPath();
5879+
Path javadocDirectory = getJavadocDirectory().toPath().toAbsolutePath();
5880+
Path javadocResourcesDirectory = basedir.relativize(javadocDirectory);
5881+
options.setJavadocResourcesDirectory(javadocResourcesDirectory.toString());
58815882
}
58825883

58835884
File optionsFile = getJavadocOptionsFile();

0 commit comments

Comments
 (0)