Skip to content

Commit dc18f3e

Browse files
committed
Bundle Javadoc with Antora documentation site.
Closes #872
1 parent 0051759 commit dc18f3e

15 files changed

+138
-87
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ work/
2424

2525
node
2626
node_modules
27-
package.json
2827
package-lock.json

pom.xml

+27
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</modules>
1919

2020
<properties>
21+
<maven.antora-version>1.0.0-alpha.4</maven.antora-version>
2122
<antora.version>0.0.3</antora.version>
2223
<assertj-core.version>3.25.1</assertj-core.version>
2324
<aws-java-sdk.version>2.21.46</aws-java-sdk.version>
@@ -996,6 +997,32 @@
996997

997998
</build>
998999
</profile>
1000+
<profile>
1001+
1002+
<id>antora</id>
1003+
1004+
<properties>
1005+
<maven.main.skip>true</maven.main.skip>
1006+
<maven.test.skip>true</maven.test.skip>
1007+
<aspectj.skip>true</aspectj.skip>
1008+
<maven.install.skip>true</maven.install.skip>
1009+
<skipTests>true</skipTests>
1010+
</properties>
1011+
1012+
<build>
1013+
<plugins>
1014+
<!-- force-skip -->
1015+
<plugin>
1016+
<groupId>org.jetbrains.kotlin</groupId>
1017+
<artifactId>kotlin-maven-plugin</artifactId>
1018+
<inherited>false</inherited>
1019+
<configuration>
1020+
<skip>true</skip>
1021+
</configuration>
1022+
</plugin>
1023+
</plugins>
1024+
</build>
1025+
</profile>
9991026
</profiles>
10001027

10011028
<pluginRepositories>
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"dependencies": {
3+
"antora": "3.2.0-alpha.6",
4+
"@antora/atlas-extension": "1.0.0-alpha.2",
5+
"@antora/collector-extension": "1.0.0-alpha.7",
6+
"@asciidoctor/tabs": "1.0.0-beta.6",
7+
"@springio/antora-extensions": "1.13.0",
8+
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
9+
}
10+
}

spring-vault-distribution/pom.xml

+17-10
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,17 @@
124124
</configuration>
125125
</plugin>
126126
<plugin>
127-
<groupId>io.spring.maven.antora</groupId>
127+
<groupId>org.antora</groupId>
128128
<artifactId>antora-maven-plugin</artifactId>
129-
<version>${antora.version}</version>
129+
<version>${maven.antora-version}</version>
130130
<extensions>true</extensions>
131131
<configuration>
132+
<playbook>${project.basedir}/../src/main/antora/antora-playbook.yml</playbook>
132133
<options>
133134
<option>--to-dir=target/antora/site</option>
134135
<option>--stacktrace</option>
135136
<option>--fetch</option>
136137
</options>
137-
<playbook>${project.basedir}/../src/main/antora/antora-playbook.yml</playbook>
138-
<packages>
139-
<package>@antora/[email protected]</package>
140-
<package>@antora/[email protected]</package>
141-
<package>@asciidoctor/[email protected]</package>
142-
<package>@springio/[email protected]</package>
143-
<package>@springio/[email protected]</package>
144-
</packages>
145138
</configuration>
146139
<executions>
147140
<execution>
@@ -245,6 +238,20 @@
245238
</goals>
246239
</execution>
247240

241+
<execution>
242+
<id>copy-javadoc</id>
243+
<phase>package</phase>
244+
<configuration>
245+
<target>
246+
<copy todir="${project.root}/target/antora/modules/ROOT/assets/attachments/api/java">
247+
<fileset dir="${project.root}/target/site/apidocs" erroronmissingdir="true" />
248+
</copy>
249+
</target>
250+
</configuration>
251+
<goals>
252+
<goal>run</goal>
253+
</goals>
254+
</execution>
248255
</executions>
249256

250257
</plugin>

src/main/antora/antora-playbook.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# The purpose of this Antora playbook is to build the docs in the current branch.
22
antora:
33
extensions:
4-
- '@springio/antora-extensions/partial-build-extension'
5-
- '@springio/antora-extensions/static-page-extension'
6-
- require: '@springio/antora-extensions/latest-version-extension'
7-
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
8-
- '@antora/collector-extension'
9-
- '@antora/atlas-extension'
10-
- require: '@springio/antora-extensions/root-component-extension'
4+
- require: '@springio/antora-extensions'
115
root_component_name: 'vault'
126
site:
137
title: Spring Vault
@@ -28,13 +22,15 @@ asciidoc:
2822
extensions:
2923
- '@asciidoctor/tabs'
3024
- '@springio/asciidoctor-extensions'
25+
- '@springio/asciidoctor-extensions/javadoc-extension'
26+
sourcemap: true
3127
urls:
3228
latest_version_segment: ''
33-
ui:
34-
bundle:
35-
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.7/ui-bundle.zip
36-
snapshot: true
3729
runtime:
3830
log:
3931
failure_level: warn
4032
format: pretty
33+
ui:
34+
bundle:
35+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
36+
snapshot: true

src/main/antora/antora.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ ext:
1010
local: true
1111
scan:
1212
dir: spring-vault-distribution/target/classes/
13+
- run:
14+
command: ./mvnw package -Pdistribute
15+
local: true
16+
scan:
17+
dir: target/antora

src/main/antora/modules/ROOT/nav.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
** xref:vault/client-support.adoc[]
1313
** xref:vault/authentication.adoc[]
1414
** xref:vault/spring-security.adoc[]
15+
16+
17+
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]

src/main/antora/modules/ROOT/pages/vault/authentication.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -980,14 +980,14 @@ VaultToken token = executor.login();
980980
Vault's tokens can be associated with a time to live. Tokens obtained by an authentication method
981981
are intended to be used as long as the session is active and should not expire while the application is active.
982982

983-
Spring Vault provides with {self-docs-root}api/org/springframework/vault/authentication/LifecycleAwareSessionManager.html[`LifecycleAwareSessionManager`] a session manager that can renew the token until it reaches its terminal TTL to then perform another login to obtain the next token which is associated with the session.
983+
Spring Vault provides with javadoc:org.springframework.vault.authentication.LifecycleAwareSessionManager[] a session manager that can renew the token until it reaches its terminal TTL to then perform another login to obtain the next token which is associated with the session.
984984

985985
Depending on the authentication method, a login can create two kinds of tokens:
986986

987-
* {self-docs-root}api/org/springframework/vault/support/VaultToken.html[`VaultToken`]: Generic token encapsulating the actual token.
988-
* {self-docs-root}api/org/springframework/vault/authentication/LoginToken.html[`LoginToken`]: Token associated with renewability/TTL.
987+
* javadoc:org.springframework.vault.support.VaultToken[]: Generic token encapsulating the actual token.
988+
* javadoc:org.springframework.vault.authentication.LoginToken[]: Token associated with renewability/TTL.
989989

990-
Authentication methods such as {self-docs-root}api/org/springframework/vault/authentication/TokenAuthentication.html[`TokenAuthentication`] just create a `VaultToken` which does not carry any renewability/TTL details. `LifecycleAwareSessionManager` will run a self-lookup on the token to retrieve renewability and TTL from Vault.
990+
Authentication methods such as javadoc:org.springframework.vault.authentication.TokenAuthentication[] just create a `VaultToken` which does not carry any renewability/TTL details. javadoc:org.springframework.vault.authentication.LifecycleAwareSessionManager[] will run a self-lookup on the token to retrieve renewability and TTL from Vault.
991991
`VaultToken` are renewed periodically if self-lookup is enabled. Note that `VaultToken` are never revoked, only `LoginToken` are revoked.
992992

993993
Authentication methods creating `LoginToken` directly (all login-based authentication methods) already provide all necessary details to setup token renewal. Tokens obtained from a login are revoked by `LifecycleAwareSessionManager` if the session manager is shut down.

src/main/antora/modules/ROOT/pages/vault/client-support.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ NOTE: Apache HttpClient's https://hc.apache.org/httpcomponents-client-5.2.x/logg
9898
[[vault.client-ssl]]
9999
== Vault Client SSL configuration
100100

101-
SSL can be configured using `SslConfiguration` by setting various properties.
101+
SSL can be configured using javadoc:org.springframework.vault.support.SslConfiguration[] by setting various properties.
102102
You can set either `javax.net.ssl.trustStore` to configure
103103
JVM-wide SSL settings or configure `SslConfiguration`
104104
to set SSL settings only for Spring Vault.
@@ -128,7 +128,7 @@ SslConfiguration.forKeyStore(new FileSystemResource("keystore.jks"), <4>
128128
<4> Configuring only key store settings with providing a key-configuration.
129129
====
130130

131-
Please note that providing `SslConfiguration` can be only applied when either Apache Http Components or the OkHttp client is on your class-path.
131+
Please note that providing javadoc:org.springframework.vault.support.SslConfiguration[] can be only applied when either Apache Http Components or the OkHttp client is on your class-path.
132132

133133
The SSL configuration supports also PEM-encoded certificates as alternative to a Java Key Store.
134134

src/main/antora/modules/ROOT/pages/vault/imperative-template.adoc

+23-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
[[vault.core.template]]
22
= Introduction to VaultTemplate
33

4-
The class `VaultTemplate`, located in the package `org.springframework.vault.core`,
4+
The class javadoc:org.springframework.vault.core.VaultTemplate[], located in the package `org.springframework.vault.core`,
55
is the central class of the Spring's Vault support providing a rich feature set to
66
interact with Vault. The template offers convenience operations to read, write and
77
delete data in Vault and provides a mapping between your domain objects and Vault data.
88

9-
NOTE: Once configured, `VaultTemplate` is thread-safe and can be reused across
9+
NOTE: Once configured, javadoc:org.springframework.vault.core.VaultTemplate[] is thread-safe and can be reused across
1010
multiple instances.
1111

1212
The mapping between Vault documents and domain classes is done by delegating to
1313
`RestTemplate`. Spring Web support provides the mapping infrastructure.
1414

15-
The `VaultTemplate` class implements the interface `VaultOperations`.
16-
In as much as possible, the methods on `VaultOperations` are named after methods
15+
The javadoc:org.springframework.vault.core.VaultTemplate[] class implements the interface
16+
javadoc:org.springframework.vault.core.VaultOperations[].
17+
In as much as possible, the methods on javadoc:org.springframework.vault.core.VaultOperations[] are named after methods
1718
available on the Vault API to make the API familiar to existing Vault developers
1819
who are used to the API and CLI. For example, you will find methods such as
1920
"write", "delete", "read", and "revoke".
@@ -22,8 +23,8 @@ the use of the Vault API and `VaultOperations`. A major difference in between
2223
the two APIs is that `VaultOperations` can be passed domain objects instead of
2324
JSON Key-Value pairs.
2425

25-
NOTE: The preferred way to reference the operations on `VaultTemplate` instance
26-
is via its interface `VaultOperations`.
26+
NOTE: The preferred way to reference the operations on javadoc:org.springframework.vault.core.VaultTemplate[] instance
27+
is via its interface javadoc:org.springframework.vault.core.VaultOperations[].
2728

2829
While there are many convenience methods on `VaultTemplate` to help you easily
2930
perform common tasks if you should need to access the Vault API directly to access
@@ -37,19 +38,20 @@ Now let's look at a examples of how to work with Vault in the context of the Spr
3738
[[vault.core.template.beans]]
3839
== Registering and configuring Spring Vault beans
3940

40-
Using Spring Vault does not require a Spring Context. However, instances of `VaultTemplate` and `SessionManager` registered inside a managed context will participate
41+
Using Spring Vault does not require a Spring Context. However, instances of `VaultTemplate` and
42+
javadoc:org.springframework.vault.authentication.SessionManager[] registered inside a managed context will participate
4143
in {spring-framework-docs}core.html#beans-factory-nature[lifecycle events]
4244
provided by the Spring IoC container. This is useful to dispose active Vault sessions upon
4345
application shutdown. You also benefit from reusing the same `VaultTemplate`
4446
instance across your application.
4547

4648
Spring Vault comes with a supporting configuration class that provides bean definitions
4749
for use inside a Spring context. Application configuration
48-
classes typically extend from `AbstractVaultConfiguration` and are required to
50+
classes typically extend from javadoc:org.springframework.vault.config.AbstractVaultConfiguration[] and are required to
4951
provide additional details that are environment specific.
5052

51-
Extending from `AbstractVaultConfiguration` requires to implement
52-
` VaultEndpoint vaultEndpoint()` and `ClientAuthentication clientAuthentication()`
53+
Extending from javadoc:org.springframework.vault.config.AbstractVaultConfiguration[] requires to implement
54+
`VaultEndpoint vaultEndpoint()` and `ClientAuthentication clientAuthentication()`
5355
methods.
5456

5557
.Registering Spring Vault objects using Java based bean metadata
@@ -78,8 +80,8 @@ public class AppConfig extends AbstractVaultConfiguration {
7880
}
7981
}
8082
----
81-
<1> Create a new `VaultEndpoint` that points by default to `\https://localhost:8200`.
82-
<2> This sample uses `TokenAuthentication` to get started quickly.
83+
<1> Create a new javadoc:org.springframework.vault.client.VaultEndpoint[] that points by default to `\https://localhost:8200`.
84+
<2> This sample uses javadoc:org.springframework.vault.authentication.TokenAuthentication[] to get started quickly.
8385
See <<vault.core.authentication>> for details on supported authentication methods.
8486
====
8587

@@ -111,14 +113,14 @@ public class AppConfig extends AbstractVaultConfiguration {
111113
}
112114
}
113115
----
114-
<1> `VaultEndpoint` can be constructed using various factory methods such as
116+
<1> javadoc:org.springframework.vault.client.VaultEndpoint[] can be constructed using various factory methods such as
115117
`from(URI uri)` or `VaultEndpoint.create(String host, int port)`.
116118
<2> Dependencies for `ClientAuthentication` methods can be obtained either from
117119
`AbstractVaultConfiguration` or provided by your configuration.
118120
====
119121

120122
NOTE: Creating a custom configuration class might be cumbersome in some cases.
121-
Take a look at `EnvironmentVaultConfiguration` that allows configuration by using
123+
Take a look at javadoc:org.springframework.vault.config.EnvironmentVaultConfiguration[] that allows configuration by using
122124
properties from existing property sources and Spring's `Environment`. Read more
123125
in <<vault.core.environment-vault-configuration>>.
124126

@@ -132,18 +134,20 @@ must be reused throughout a session. This aspect is handled by a
132134
`SessionManager` implementation. A `SessionManager` decides how often it
133135
obtains a token, about revocation and renewal. Spring Vault comes with two implementations:
134136

135-
* `SimpleSessionManager`: Just obtains tokens from the supplied
137+
* javadoc:org.springframework.vault.authentication.SimpleSessionManager[]: Just obtains tokens from the supplied
136138
`ClientAuthentication` without refresh and revocation
137-
* `LifecycleAwareSessionManager`: This `SessionManager` schedules token
139+
* javadoc:org.springframework.vault.authentication.LifecycleAwareSessionManager[]: This `SessionManager` schedules token
138140
renewal if a token is renewable and revoke a login token on disposal.
139141
Renewal is scheduled with an `AsyncTaskExecutor`. `LifecycleAwareSessionManager`
140142
is configured by default if using `AbstractVaultConfiguration`.
141143

142144
[[vault.core.environment-vault-configuration]]
143145
== Using `EnvironmentVaultConfiguration`
144146

145-
Spring Vault includes `EnvironmentVaultConfiguration` configure the Vault client from Spring's `Environment` and a set of predefined
146-
property keys. `EnvironmentVaultConfiguration` supports frequently applied configurations. Other configurations are supported by deriving from the most appropriate configuration class. Include `EnvironmentVaultConfiguration` with `@Import(EnvironmentVaultConfiguration.class)` to existing
147+
Spring Vault includes javadoc:org.springframework.vault.config.EnvironmentVaultConfiguration[] configure the Vault client from Spring's `Environment` and a set of predefined
148+
property keys.
149+
javadoc:org.springframework.vault.config.EnvironmentVaultConfiguration[] supports frequently applied configurations. Other configurations are supported by deriving from the most appropriate configuration class.
150+
Include javadoc:org.springframework.vault.config.EnvironmentVaultConfiguration[] with `@Import(EnvironmentVaultConfiguration.class)` to existing
147151
Java-based configuration classes and supply configuration properties through any of Spring's ``PropertySource``s.
148152

149153
.Using EnvironmentVaultConfiguration with a property file
@@ -238,7 +242,7 @@ One common design feature of all Spring template classes is that all functionali
238242
This helps ensure that exceptions and any resource management that maybe required are performed consistency.
239243
While this was of much greater need in the case of JDBC and JMS than with Vault, it still offers a single spot for access and logging to occur.
240244
As such, using the execute callback is the preferred way to access the Vault API
241-
to perform uncommon operations that we've not exposed as methods on `VaultTemplate`.
245+
to perform uncommon operations that we've not exposed as methods on javadoc:org.springframework.vault.core.VaultTemplate[].
242246

243247
Here is a list of execute callback methods.
244248

src/main/antora/modules/ROOT/pages/vault/propertysource.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Vault can be used in many different ways. One specific use-case is using
55
Vault to store encrypted properties. Spring Vault supports Vault as property
66
source to obtain configuration properties using Spring's {spring-framework-docs}core.html#beans-property-source-abstraction[PropertySource abstraction].
77

8-
NOTE: You can reference properties stored inside Vault in other property sources or use value injection with `@Value(…)`. Special attention is required when bootstrapping beans that require data stored inside of Vault. A `VaultPropertySource` must be initialized at that time to retrieve properties from Vault.
8+
NOTE: You can reference properties stored inside Vault in other property sources or use value injection with `@Value(…)`. Special attention is required when bootstrapping beans that require data stored inside of Vault. A javadoc:org.springframework.vault.core.env.VaultPropertySource[] must be initialized at that time to retrieve properties from Vault.
99

1010
NOTE: Spring Boot/Spring Cloud users can benefit from https://github.com/spring-cloud/spring-cloud-vault-config[Spring Cloud Vault]'s
1111
configuration integration that initializes various property sources during application startup.
1212

1313
== Registering `VaultPropertySource`
1414

15-
Spring Vault provides a `VaultPropertySource` to be used with Vault to obtain
15+
Spring Vault provides a javadoc:org.springframework.vault.core.env.VaultPropertySource[] to be used with Vault to obtain
1616
properties. It uses the nested `data` element to expose properties stored and
1717
encrypted in Vault.
1818

@@ -25,7 +25,7 @@ sources.addFirst(new VaultPropertySource(vaultTemplate, "secret/my-application")
2525
----
2626
====
2727

28-
In the code above, `VaultPropertySource` has been added with highest precedence
28+
In the code above, javadoc:org.springframework.vault.core.env.VaultPropertySource[] has been added with highest precedence
2929
in the search. If it contains a ´foo` property, it will be detected and returned
3030
ahead of any `foo` property in any other `PropertySource`.
3131
`MutablePropertySources` exposes a number of methods that allow for precise

0 commit comments

Comments
 (0)