Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
* Move Antora-based documentation underneath src/main/antora.
* Put Antora build process behind a maven profile so it doesn't run on standard CI jobs.
* Refine build process so that final document includes injected build properties.
* Drop epub artwork since we no longer publish that.

See #2876
  • Loading branch information
gregturn committed Jul 19, 2023
1 parent 876e319 commit 854c375
Show file tree
Hide file tree
Showing 39 changed files with 95 additions and 99 deletions.
4 changes: 2 additions & 2 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ antora:
root_component_name: 'data-commons'
site:
title: Spring Data Reference
url: https://https://rwinch.github.io/spring-data-commons/
url: https://rwinch.github.io/spring-data-commons/
content:
sources:
- url: .
branches: HEAD
start_path: .
start_path: src/main/antora
worktrees: true
asciidoc:
attributes:
Expand Down
Binary file removed modules/ROOT/assets/images/epub-cover.png
Binary file not shown.
11 changes: 0 additions & 11 deletions modules/ROOT/assets/images/epub-cover.svg

This file was deleted.

171 changes: 90 additions & 81 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -366,90 +366,99 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<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>
<!-- 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>
</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>
<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>

<profiles>
<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 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>
<!-- 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>
</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>
<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>

<repositories>
<repository>
<id>spring-snapshot</id>
Expand Down
4 changes: 2 additions & 2 deletions antora.yml → src/main/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav:
ext:
collector:
- run:
command: mvnw resources:resources
command: mvnw -Pdocs resources:resources
local: true
scan:
dir: ./target/classes/antora-resources
dir: target/classes/antora-resources
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Oliver Gierke; Thomas Darimont; Christoph Strobl; Mark Pollack; Thomas Risberg;
:revnumber: {version}
:revdate: {localdate}
:feature-scroll: true
ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]]

(C) 2008-2022 The original authors.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Oliver Gierke; Thomas Darimont; Christoph Strobl; Mark Pollack; Thomas Risberg;
:revnumber: {version}
:revdate: {localdate}
:feature-scroll: true
ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]]

(C) 2008-2022 The original authors.

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/antora-resources/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ asciidoc:
spring-framework-javadoc: {springjavadocurl}
releasetrainversion: 2023.0.1 # FIXME this is wrong
store: Jpa
springhateoasversion: 2.2.0-SNAPSHOT
springhateoasversion: ${spring-hateoas}

0 comments on commit 854c375

Please sign in to comment.