Skip to content

Use antora-maven-plugin #3095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV
- name: Run Antora
run: |
./mvnw compile
./mvnw antora
- name: Publish Docs
uses: spring-io/spring-doc-actions/[email protected]
with:
docs-username: ${{ secrets.DOCS_USERNAME }}
docs-host: ${{ secrets.DOCS_HOST }}
docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
site-path: target/site
site-path: spring-data-jpa/target/antora/site
- name: Bust Cloudflare Cache
uses: spring-io/spring-doc-actions/[email protected]
with:
Expand Down
11 changes: 10 additions & 1 deletion antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
antora:
extensions:
- '@springio/antora-extensions/partial-build-extension'
- require: '@springio/antora-extensions/latest-version-extension'
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
- '@antora/collector-extension'
- './antora/lib/version-fix.js'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: 'data-jpa'
Expand All @@ -15,7 +17,14 @@ git:
content:
sources:
- url: https://github.com/spring-projects/spring-data-jpa
branches: [main]
# Refname matching:
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
branches: [ main,'({3..9}).+({0..9}).x', '!(3.{0..1}.x)' ]
tags: [ '({3..9}).+({0..9}).+({0..9})?(-{RC,M}+({0..9}))', '!(3.{0..1}.+({0..9})?(-{RC,M}+({0..9})))','!(3.2.0-M1)','!(3.2.0-M2)' ]
start_path: spring-data-jpa/src/main/antora
- url: https://github.com/spring-projects/spring-data-jpa
branches: []
tags: [ '3.2.0-M2' ]
start_path: src/main/antora
asciidoc:
attributes:
Expand Down
18 changes: 18 additions & 0 deletions antora/lib/version-fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict'

/**
* The purpose of this extension is to fix invalid metadata saved to either antora.yml or gradle.properties in certain
* tags. This invalid metadata prevents Antora from classifying the component versions properly.
*
* This extension should be listed directly after @antora/collector-extension.
*/
module.exports.register = function () {
this.once('contentAggregated', ({ contentAggregate }) => {
contentAggregate.forEach((componentVersionBucket) => {
if (componentVersionBucket.version === '3.2.0-SNAPSHOT') {
componentVersionBucket.version = '3.2.0'
componentVersionBucket.prerelease = '-SNAPSHOT'
}
})
})
}
103 changes: 15 additions & 88 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,103 +27,30 @@
<scala>2.11.7</scala>
<xmlbeam>1.4.24</xmlbeam>
<java-module-name>spring.data.jpa</java-module-name>

<!-- 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.5.0</spring-antora-extensions.version>
<spring-asciidoctor-extensions.version>1.0.0-alpha.9</spring-asciidoctor-extensions.version>

<io.spring.maven.antora-version>0.0.3</io.spring.maven.antora-version>
</properties>


<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<executions>
<execution>
<id>install node and npm</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>
<environmentVariables>
<ALGOLIA_API_KEY>9d489079e5ec46dbb238909fee5c9c29</ALGOLIA_API_KEY>
<ALGOLIA_APP_ID>WB1FQYI187</ALGOLIA_APP_ID>
<ALGOLIA_INDEX_NAME>springdatajpa</ALGOLIA_INDEX_NAME>
</environmentVariables>
<!-- 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>antora-playbook.yml</argument>
<argument>--to-dir=target/site</argument>
<argument>--stacktrace</argument>
</arguments>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<groupId>io.spring.maven.antora</groupId>
<artifactId>antora-maven-plugin</artifactId>
<version>${io.spring.maven.antora-version}</version>
<extensions>true</extensions>
<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>
<options>
<option>--to-dir=target/antora/site</option>
<option>--stacktrace</option>
<option>--fetch</option>
</options>
<environment>
<ALGOLIA_API_KEY>9d489079e5ec46dbb238909fee5c9c29</ALGOLIA_API_KEY>
<ALGOLIA_APP_ID>WB1FQYI187</ALGOLIA_APP_ID>
<ALGOLIA_INDEX_NAME>springdatajpa</ALGOLIA_INDEX_NAME>
</environment>
</configuration>
</plugin>

</plugins>
</build>

Expand Down