1
1
plugins {
2
- id " org.asciidoctor.jvm.convert "
2
+ id " org.antora "
3
3
id " org.springframework.boot.conventions"
4
4
id " org.springframework.boot.maven-plugin"
5
5
id " org.springframework.boot.optional-dependencies"
@@ -9,12 +9,10 @@ description = "Spring Boot Maven Plugin"
9
9
10
10
configurations {
11
11
dependenciesBom
12
- documentation
12
+ antoraContent
13
13
}
14
14
15
15
dependencies {
16
- asciidoctorExtensions(" io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids" )
17
-
18
16
compileOnly(" org.apache.maven.plugin-tools:maven-plugin-annotations" )
19
17
compileOnly(" org.sonatype.plexus:plexus-build-api" )
20
18
compileOnly(" org.apache.maven:maven-core" ) {
@@ -37,6 +35,21 @@ dependencies {
37
35
implementation(" org.springframework:spring-core" )
38
36
implementation(" org.springframework:spring-context" )
39
37
38
+ testImplementation(" org.apache.maven:maven-core" ) {
39
+ exclude(group : " javax.annotation" , module : " javax.annotation-api" )
40
+ exclude(group : " javax.inject" , module : " javax.inject" )
41
+ }
42
+ testImplementation(" org.apache.maven.shared:maven-common-artifact-filters" ) {
43
+ exclude(group : " javax.annotation" , module : " javax.annotation-api" )
44
+ exclude(group : " javax.enterprise" , module : " cdi-api" )
45
+ exclude(group : " javax.inject" , module : " javax.inject" )
46
+ }
47
+ testImplementation(" org.assertj:assertj-core" )
48
+ testImplementation(" org.junit.jupiter:junit-jupiter" )
49
+ testImplementation(" org.mockito:mockito-core" )
50
+ testImplementation(" org.mockito:mockito-junit-jupiter" )
51
+ testImplementation(" org.springframework:spring-core" )
52
+
40
53
intTestImplementation(project(" :spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform" ))
41
54
intTestImplementation(project(" :spring-boot-project:spring-boot-tools:spring-boot-loader-tools" ))
42
55
intTestImplementation(project(" :spring-boot-project:spring-boot-tools:spring-boot-test-support" ))
@@ -61,21 +74,6 @@ dependencies {
61
74
62
75
runtimeOnly(" org.sonatype.plexus:plexus-build-api" )
63
76
64
- testImplementation(" org.apache.maven:maven-core" ) {
65
- exclude(group : " javax.annotation" , module : " javax.annotation-api" )
66
- exclude(group : " javax.inject" , module : " javax.inject" )
67
- }
68
- testImplementation(" org.apache.maven.shared:maven-common-artifact-filters" ) {
69
- exclude(group : " javax.annotation" , module : " javax.annotation-api" )
70
- exclude(group : " javax.enterprise" , module : " cdi-api" )
71
- exclude(group : " javax.inject" , module : " javax.inject" )
72
- }
73
- testImplementation(" org.assertj:assertj-core" )
74
- testImplementation(" org.junit.jupiter:junit-jupiter" )
75
- testImplementation(" org.mockito:mockito-core" )
76
- testImplementation(" org.mockito:mockito-junit-jupiter" )
77
- testImplementation(" org.springframework:spring-core" )
78
-
79
77
versionProperties(project(path : " :spring-boot-project:spring-boot-dependencies" , configuration : " effectiveBom" ))
80
78
}
81
79
84
82
xsdVersion = versionElements[0 ] + " ." + versionElements[1 ]
85
83
}
86
84
87
- syncDocumentationSourceForAsciidoctor {
88
- from(documentPluginGoals) {
89
- into " asciidoc/goals"
90
- }
91
- }
92
-
93
85
sourceSets {
94
86
main {
95
87
output. dir(" ${ buildDir} /generated/resources/xsd" , builtBy : " xsdResources" )
@@ -99,30 +91,6 @@ sourceSets {
99
91
}
100
92
}
101
93
102
- tasks. withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask ) {
103
- doFirst {
104
- attributes " spring-boot-xsd-version" : project. ext. xsdVersion
105
- }
106
- }
107
-
108
- asciidoctor {
109
- sources {
110
- include " index.adoc"
111
- }
112
- }
113
-
114
- task asciidoctorPdf (type : org.asciidoctor.gradle.jvm.AsciidoctorTask ) {
115
- sources {
116
- include " index.adoc"
117
- }
118
- }
119
-
120
- syncDocumentationSourceForAsciidoctorPdf {
121
- from(documentPluginGoals) {
122
- into " asciidoc/goals"
123
- }
124
- }
125
-
126
94
javadoc {
127
95
options {
128
96
author = true
@@ -136,21 +104,6 @@ javadoc {
136
104
}
137
105
}
138
106
139
- task zip (type : Zip ) {
140
- dependsOn asciidoctor, asciidoctorPdf
141
- duplicatesStrategy " fail"
142
- from(asciidoctorPdf. outputDir) {
143
- into " reference/pdf"
144
- rename " index.pdf" , " ${ project.name} -reference.pdf"
145
- }
146
- from(asciidoctor. outputDir) {
147
- into " reference/htmlsingle"
148
- }
149
- from(javadoc) {
150
- into " api"
151
- }
152
- }
153
-
154
107
task xsdResources (type : Sync ) {
155
108
from " src/main/xsd/layers-${ project.ext.xsdVersion} .xsd"
156
109
into " ${ buildDir} /generated/resources/xsd/org/springframework/boot/maven"
@@ -161,10 +114,6 @@ prepareMavenBinaries {
161
114
versions " 3.9.0" , " 3.8.5" , " 3.6.3"
162
115
}
163
116
164
- artifacts {
165
- " documentation" zip
166
- }
167
-
168
117
tasks. named(" documentPluginGoals" ) {
169
118
goalSections = [
170
119
" build-image" : " build-image" ,
@@ -180,3 +129,43 @@ tasks.named("documentPluginGoals") {
180
129
" test-run" : " run"
181
130
]
182
131
}
132
+
133
+ def antoraMavenPluginLocalAggregateContent = tasks. register(" antoraMavenPluginLocalAggregateContent" , Zip ) {
134
+ destinationDirectory = layout. buildDirectory. dir(' generated/docs/antora-content' )
135
+ archiveClassifier = " maven-plugin-local-aggregate-content"
136
+ from(tasks. getByName(" generateAntoraYml" )) {
137
+ into " modules"
138
+ }
139
+ }
140
+
141
+ def antoraMavenPluginAggregateContent = tasks. register(" antoraMavenPluginAggregateContent" , Zip ) {
142
+ destinationDirectory = layout. buildDirectory. dir(' generated/docs/antora-content' )
143
+ archiveClassifier = " maven-plugin-aggregate-content"
144
+ from(documentPluginGoals) {
145
+ into " modules/maven-plugin/partials/goals"
146
+ }
147
+ }
148
+
149
+ def antoraMavenPluginCatalogContent = tasks. register(" antoraMavenPluginCatalogContent" , Zip ) {
150
+ destinationDirectory = layout. buildDirectory. dir(' generated/docs/antora-content' )
151
+ archiveClassifier = " maven-plugin-catalog-content"
152
+ from(javadoc) {
153
+ into " api/java"
154
+ }
155
+ }
156
+
157
+ tasks. named(" generateAntoraPlaybook" ) {
158
+ xrefStubs = [" appendix:.*" , " api:.*" , " reference:.*" ]
159
+ alwaysInclude = [name : " maven-plugin" , classifier : " local-aggregate-content" ]
160
+ dependsOn antoraMavenPluginLocalAggregateContent
161
+ }
162
+
163
+
164
+ tasks. named(" antora" ) {
165
+ inputs. files(antoraMavenPluginLocalAggregateContent, antoraMavenPluginAggregateContent, antoraMavenPluginCatalogContent)
166
+ }
167
+
168
+ artifacts {
169
+ antoraContent antoraMavenPluginAggregateContent
170
+ antoraContent antoraMavenPluginCatalogContent
171
+ }
0 commit comments