Skip to content

Commit

Permalink
Use io.spring.maven.antora plugins.
Browse files Browse the repository at this point in the history
- Switch to io.spring.maven.antora plugins
- Move Antora to spring-data-jpa modulen. Placing in parent folder
  means that each module will also have the Antora plugin applied to it
  and the antora task will fail on those modules.

See #3094
  • Loading branch information
rwinch authored and gregturn committed Aug 18, 2023
1 parent d6bd571 commit 68f7149
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 102 deletions.
98 changes: 1 addition & 97 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@

<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>

<!-- Antora -->
<node.version>v18.12.1</node.version>
<npm.version>8.19.2</npm.version>
<antora.version>3.2.0-alpha.2</antora.version>
<antora-atlas.version>1.0.0-alpha.1</antora-atlas.version>
<antora-collector.version>1.0.0-alpha.3</antora-collector.version>
<asciidoctor-tabs.version>1.0.0-beta.3</asciidoctor-tabs.version>
<spring-antora-extensions.version>1.4.0</spring-antora-extensions.version>
<spring-asciidoctor-extensions.version>1.0.0-alpha.9</spring-asciidoctor-extensions.version>

</properties>

<modules>
Expand Down Expand Up @@ -117,93 +107,6 @@
<eclipselink>4.0.2</eclipselink>
</properties>
</profile>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<executions>
<execution>
<id>install-antora</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>initialize</phase>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install antora</id>
<goals>
<goal>npm</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>install @antora/cli@${antora.version} @antora/site-generator-default@${antora.version} @antora/atlas-extension@${antora-atlas.version} @antora/collector-extension@${antora-collector.version} @asciidoctor/tabs@${asciidoctor-tabs.version} @springio/antora-extensions@${spring-antora-extensions.version} @springio/asciidoctor-extensions@${spring-asciidoctor-extensions.version}</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>antora</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<!-- If we don't want to depend on default node installation path we can use a maven
property aligned with frontend-maven-plugin's installDirectory configuration -->
<executable>node/node</executable>
<arguments>
<argument>node_modules/.bin/antora</argument>
<argument>src/main/antora/antora-playbook.yml</argument>
<argument>--to-dir=target/site</argument>
</arguments>
<workingDirectory>${project.parent.basedir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>node</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>node_modules</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>build</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
</profiles>

<dependencyManagement>
Expand Down Expand Up @@ -304,6 +207,7 @@
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
24 changes: 24 additions & 0 deletions spring-data-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<properties>
<java-module-name>spring.data.jpa</java-module-name>
<io.spring.maven.antora-version>0.0.3</io.spring.maven.antora-version>
</properties>

<dependencies>
Expand Down Expand Up @@ -430,6 +431,29 @@
</configuration>
</plugin>



<plugin>
<groupId>io.spring.maven.antora</groupId>
<artifactId>antora-maven-plugin</artifactId>
<version>${io.spring.maven.antora-version}</version>
<extensions>true</extensions>
<configuration>
<playbook>src/main/antora/antora-playbook.yml</playbook>
</configuration>
</plugin>
<plugin>
<groupId>io.spring.maven.antora</groupId>
<artifactId>antora-component-version-maven-plugin</artifactId>
<version>${io.spring.maven.antora-version}</version>
<executions>
<execution>
<goals>
<goal>antora-component-version</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ site:
url: https://docs.spring.io/spring-data-jpa/reference/
content:
sources:
- url: ./../../..
- url: ./../../../..
branches: HEAD
start_path: src/main/antora
start_path: spring-data-jpa/src/main/antora
worktrees: true
asciidoc:
attributes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav:
ext:
collector:
- run:
command: mvnw -Pdocs resources:resources
command: mvnw validate resources:resources -pl :spring-data-jpa -am
local: true
scan:
dir: target/classes/antora-resources
dir: spring-data-jpa/target/classes/antora-resources
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: ${project.version}
version: ${antora-component.version}
prerelease: ${antora-component.prerelease}

asciidoc:
attributes:
Expand Down

0 comments on commit 68f7149

Please sign in to comment.