Skip to content

Commit

Permalink
HSEARCH-5234 Use an explicit directory for javadocs output
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Sep 3, 2024
1 parent 672c29d commit 319375c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class ConfigurationPropertyProcessor implements AutoCloseable {
private final String javadocFolderName;
private final Path target;
private final Path output;
private final String javadocsBaseDir;

public ConfigurationPropertyProcessor(String javadocFolderName, String javadocsBaseLink, Path target, Path output,
String artifact, String moduleName) {
String artifact, String moduleName, String javadocsBaseDir) {
this.javadocFolderName = javadocFolderName;
this.target = target;
this.output = output;
this.fileName = artifact.startsWith( "_" ) ? artifact : "_" + artifact;
this.javadocsBaseDir = javadocsBaseDir;

this.propertyCollector = new ConfigurationPropertyCollector( javadocsBaseLink, locateJavaDocDirectory(), artifact,
moduleName
Expand All @@ -50,6 +52,7 @@ public static void main(String[] args) {
Path output = new File( args[2] ).toPath();
String artifact = args[3];
String moduleName = args[4];
String javadocsBaseDir = args[5];

// we don't want to run this processor on parent poms so if that's what we got - return fast:
if ( artifact.startsWith( "hibernate-search-parent-public" ) ) {
Expand All @@ -62,7 +65,8 @@ public static void main(String[] args) {
target,
output,
artifact,
moduleName
moduleName,
javadocsBaseDir
) ) {
processor.process();
}
Expand Down Expand Up @@ -108,7 +112,7 @@ private void writeProperties(String fileName, BiConsumer<Map<String, Configurati
}

private Path locateJavaDocDirectory() {
Path javadocsLocation = target.resolve( "reports" ).resolve( javadocFolderName );
Path javadocsLocation = target.resolve( javadocsBaseDir ).resolve( javadocFolderName );
if ( !Files.exists( javadocsLocation ) ) {
throw new IllegalStateException(
"Was unable to locate javadocs. No processing is possible. Make sure that " +
Expand Down
1 change: 1 addition & 0 deletions build/parents/public/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
<argument>${documentation.config.properties.output.directory}</argument>
<argument>${project.artifactId}</argument>
<argument>${project.name}</argument>
<argument>${javadoc.generate.html.directory}</argument>
</arguments>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
<injection-plugin.phase>compile</injection-plugin.phase>

<javadoc.generate.jar.phase>none</javadoc.generate.jar.phase>
<javadoc.generate.html.directory>rendered-javadocs</javadoc.generate.html.directory>

<logging.processor.skip.generated.annotation.compiler.argument></logging.processor.skip.generated.annotation.compiler.argument>

Expand Down Expand Up @@ -688,6 +689,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.javadoc.plugin}</version>
<configuration>
<outputDirectory>${project.build.directory}/${javadoc.generate.html.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 319375c

Please sign in to comment.