This plugin defines Maven properties that can be used for generating an antora.yml.
The antora.yml
can be included using the Antora Collector Extension.
Maven Property Name | Antora Key | Description |
---|---|---|
|
Generates the Antora version attribute from the Maven version property by, if present, removing |
|
|
Generates the Antora prerelease attribute from the Maven version property:
|
This section describes how to configure and use the antora-component-version-maven-plugin
.
To start, define the plugin in your build:
<plugin>
<groupId>io.spring.maven.antora</groupId>
<artifactId>antora-component-version-maven-plugin</artifactId>
<version>0.0.4</version>
<executions>
<execution>
<goals>
<goal>antora-component-version</goal>
</goals>
</execution>
</executions>
</plugin>
Next, create a resource that will have Maven Filtering performed on it.
The plugin adds the folder src/main/antora/resources
as a filtered resource by default and we will use that location in our example.
Alternatively, you can explicitly add Maven Filtering to any location and place it there.
Here is an example using the default location:
version: ${antora-component.version}
prerelease: ${antora-component.prerelease}
asciidoc:
attributes:
attribute-missing: 'warn'
# ... more attributes (possibly with values from other properties) as needed ...
Note
|
The folder antora-resources is used so that the Antora Collector Extension can import Antora resources without picking up any other resources your project may have (e.g. resources for your Java project).
|
Finally, you can generate the resource by invoking process-resources
:
$ mvn process-resources; cat target/classes/antora-resources/antora.yml
...
version: 1.0.0
prerelease: -SNAPSHOT
asciidoc:
attributes:
attribute-missing: 'warn'
To use this with the Antora Collector Extension, you need to define the command in the collector configuration. For example:
name: data-commons
version: true
title: Spring Data Commons
nav:
- modules/ROOT/nav.adoc
ext:
collector:
- run:
command: mvnw -Pdocs process-resources
local: true
scan:
dir: target/classes/antora-resources
This is no longer maintained. Please see https://gitlab.com/antora/antora-maven-plugin/-/tree/main/