Skip to content

Commit

Permalink
HADOOP-18751. Fix incorrect output path in javadoc build phase (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
GauthamBanasandra authored Jun 26, 2023
1 parent a4cf4c3 commit a85272c
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion hadoop-project-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<source>${maven.compile.source}</source>
<charset>${maven.compile.encoding}</charset>
<reportOutputDirectory>${project.build.directory}/site</reportOutputDirectory>
<destDir>${project.build.directory}/api</destDir>
<destDir>${destDirPath}</destDir>
<groups>
<group>
<title>${project.name} API</title>
Expand Down Expand Up @@ -207,6 +207,36 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>choose-javadoc-dest-dir</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<!-- destDirPath is where the generated Javadocs will be located.
The value of destDirPath obtained below is used for the "destDir" attribute
in the maven-javadoc-plugin in this pom.xml.
As per HADOOP-8500 and HADOOP-13784, we wanted to dump the javadoc into an
"api" directory that was outside the "site" directory.
Unfortunately, maven-javadoc-plugin doesn't give us a way to do that since
"destDir" is always appended to "reportOutputDirectory". While we can achieve
this using the relative path "../api", it only works for Windows. But it fails
on Linux since the parent directory of "../api" wouldn't yet exist and the
path resolution fails.
Thus, we're going to leverage this approach for Windows and leave the
behaviour on Linux intact.-->
<condition property="destDirPath" value="../api" else="${project.build.directory}/api">
<and>
<os family="windows"/>
</and>
</condition>
<echo>destDirPath to use for maven-javadoc-plugin = ${destDirPath}</echo>
</target>
</configuration>
</execution>

<!-- Pre site -->
<execution>
Expand Down

0 comments on commit a85272c

Please sign in to comment.