Skip to content

Commit 8580da4

Browse files
committed
Bundle Javadoc with Antora documentation site.
Closes #3549
1 parent ff07a00 commit 8580da4

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ target/
1010
.DS_Store
1111
node_modules
1212
package-lock.json
13-
package.json
1413
node
1514
build/
1615
.mvn/.gradle-enterprise
+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-data-jpa-distribution/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</plugin>
5252

5353
<plugin>
54-
<groupId>io.spring.maven.antora</groupId>
54+
<groupId>org.antora</groupId>
5555
<artifactId>antora-maven-plugin</artifactId>
5656
</plugin>
5757
</plugins>

src/main/antora/antora-playbook.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
# The purpose of this Antora playbook is to build the docs in the current branch.
44
antora:
55
extensions:
6-
- '@antora/collector-extension'
7-
- require: '@springio/antora-extensions/root-component-extension'
6+
- require: '@springio/antora-extensions'
87
root_component_name: 'data-jpa'
98
site:
109
title: Spring Data JPA
11-
url: https://docs.spring.io/spring-data/jpa/reference/
10+
url: https://docs.spring.io/spring-data/jpa/reference
1211
content:
1312
sources:
1413
- url: ./../../..
@@ -22,13 +21,12 @@ content:
2221
start_path: src/main/antora
2322
asciidoc:
2423
attributes:
25-
page-pagination: ''
2624
hide-uri-scheme: '@'
2725
tabs-sync-option: '@'
28-
chomp: 'all'
2926
extensions:
3027
- '@asciidoctor/tabs'
3128
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/javadoc-extension'
3230
sourcemap: true
3331
urls:
3432
latest_version_segment: ''
@@ -38,5 +36,5 @@ runtime:
3836
format: pretty
3937
ui:
4038
bundle:
41-
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.3/ui-bundle.zip
39+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
4240
snapshot: true

src/main/antora/antora.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ nav:
55
- modules/ROOT/nav.adoc
66
ext:
77
collector:
8+
- run:
9+
command: ./mvnw test-compile
10+
local: true
811
- run:
912
command: ./mvnw validate process-resources -pl :spring-data-jpa-distribution -am -Pantora-process-resources
1013
local: true
1114
scan:
12-
dir: spring-data-jpa-distribution/target/classes/
15+
dir: spring-data-jpa-distribution/target/classes
16+
- run:
17+
command: ./mvnw package -Pdistribute
18+
local: true
19+
scan:
20+
dir: target/antora

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@
3232
** xref:envers/configuration.adoc[]
3333
** xref:envers/usage.adoc[]
3434
35-
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
35+
* xref:attachment$api/java/index.html[Javadoc,role=link-external, window=_blank]
36+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external, window=_blank]

src/main/antora/modules/ROOT/pages/jpa/entity-persistence.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Spring Data JPA offers the following strategies to detect whether an entity is n
1919
If the identifier property is `null`, then the entity is assumed to be new.
2020
Otherwise, it is assumed to be not new.
2121
2. Implementing `Persistable`: If an entity implements `Persistable`, Spring Data JPA delegates the new detection to the `isNew(…)` method of the entity. See the link:$$https://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html$$[JavaDoc] for details.
22-
3. Implementing `EntityInformation`: You can customize the `EntityInformation` abstraction used in the `SimpleJpaRepository` implementation by creating a subclass of `JpaRepositoryFactory` and overriding the `getEntityInformation(…)` method accordingly. You then have to register the custom implementation of `JpaRepositoryFactory` as a Spring bean. Note that this should be rarely necessary. See the link:$$https://docs.spring.io/spring-data/data-jpa/docs/current/api/index.html?org/springframework/data/jpa/repository/support/JpaRepositoryFactory.html$$[JavaDoc] for details.
22+
3. Implementing `EntityInformation`: You can customize the `EntityInformation` abstraction used in the `SimpleJpaRepository` implementation by creating a subclass of `JpaRepositoryFactory` and overriding the `getEntityInformation(…)` method accordingly. You then have to register the custom implementation of `JpaRepositoryFactory` as a Spring bean. Note that this should be rarely necessary. See the javadoc:org.springframework.data.jpa.repository.support.JpaRepositoryFactory[JavaDoc] for details.
2323

2424
Option 1 is not an option for entities that use manually assigned identifiers and no version attribute as with those the identifier will always be non-`null`.
2525
A common pattern in that scenario is to use a common base class with a transient flag defaulting to indicate a new instance and using JPA lifecycle callbacks to flip that flag on persistence operations:

src/main/antora/modules/ROOT/pages/jpa/transactions.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[transactions]]
22
= Transactionality
33

4-
By default, methods inherited from `CrudRepository` inherit the transactional configuration from link:$$https://docs.spring.io/spring-data/data-jpa/docs/current/api/org/springframework/data/jpa/repository/support/SimpleJpaRepository.html$$[`SimpleJpaRepository`].
4+
By default, methods inherited from `CrudRepository` inherit the transactional configuration from javadoc:org.springframework.data.jpa.repository.support.SimpleJpaRepository[].
55
For read operations, the transaction configuration `readOnly` flag is set to `true`.
66
All others are configured with a plain `@Transactional` so that default transaction configuration applies.
77
Repository methods that are backed by transactional repository fragments inherit the transactional attributes from the actual fragment method.

0 commit comments

Comments
 (0)