Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
182 lines (179 loc) · 6.74 KB
/
Copy pathpom.xml
File metadata and controls
182 lines (179 loc) · 6.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>docs</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<groupId>org.springdoc</groupId>
<version>3.1.2-SNAPSHOT</version>
<properties>
<springdoc.version2>2.10.0</springdoc.version2>
<springdoc-legacy.version>1.8.0</springdoc-legacy.version>
<springdoc.version>3.2.0</springdoc.version>
<java.version>1.8</java.version>
<refdocs.build.directory>${project.basedir}/docs</refdocs.build.directory>
<spring-asciidoctor-backends.version>0.0.5</spring-asciidoctor-backends.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${refdocs.build.directory}</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>CNAME</exclude>
<exclude>ads.txt</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<attributes>
<springdoc-version>${springdoc.version}</springdoc-version>
<springdoc-version2>${springdoc.version2}</springdoc-version2>
<springdoc-legacy-version>${springdoc-legacy.version}</springdoc-legacy-version>
<!-- Applies to every document, not just the three index pages: it is what lets the
standalone pages pick up docinfo.html (analytics) and their own
<page>-docinfo.html (title, description, canonical, structured data). -->
<docinfo>shared,private</docinfo>
</attributes>
</configuration>
<executions>
<execution>
<id>generate-html-documentation</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>spring-html</backend>
<outputDirectory>${refdocs.build.directory}</outputDirectory>
<preserveDirectories>true</preserveDirectories>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>io.spring.asciidoctor.backends</groupId>
<artifactId>spring-asciidoctor-backends</artifactId>
<version>${spring-asciidoctor-backends.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resource-one</id>
<!-- Bound to generate-resources (after the asciidoctor plugin, which is declared
earlier in this build) so the springdoc images overwrite the backend's theme
assets and every version directory (root, v1, v2) gets the full image set even
when the build is invoked with the generate-resources goal. -->
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${refdocs.build.directory}</outputDirectory>
<resources>
<resource>
<targetPath>${refdocs.build.directory}/img</targetPath>
<directory>src/docs/asciidoc/img</directory>
</resource>
<resource>
<targetPath>${refdocs.build.directory}/v1/img</targetPath>
<directory>src/docs/asciidoc/img</directory>
</resource>
<resource>
<targetPath>${refdocs.build.directory}/v2/img</targetPath>
<directory>src/docs/asciidoc/img</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<!-- Every other page gets its SEO head from an Asciidoctor docinfo file. The three
index pages cannot: their <title> is derived from the document title, which is
also the visible <h1>, so the search-friendly title has to be swapped in here. -->
<execution>
<id>rewrite-index-titles</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<replace file="${refdocs.build.directory}/index.html"
token="<title>springdoc-openapi v${springdoc.version}</title>"
value="<title>springdoc-openapi &#8212; OpenAPI 3 &amp; Swagger UI for Spring Boot</title>"/>
<replace file="${refdocs.build.directory}/v2/index.html"
token="<title>springdoc-openapi v${springdoc.version2}</title>"
value="<title>springdoc-openapi v2 &#8212; OpenAPI 3 for Spring Boot 3</title>"/>
<replace file="${refdocs.build.directory}/v1/index.html"
token="<title>springdoc-openapi v${springdoc-legacy.version}</title>"
value="<title>springdoc-openapi v1 &#8212; OpenAPI 3 for Spring Boot 2</title>"/>
</target>
</configuration>
</execution>
<!-- The spring-html backend unconditionally copies its own asset bundle into every
output directory. Font Awesome (fonts/ + css/font-awesome.css) and the three
sourcemaps are never referenced by any generated page - site.css declares no
@font-face and draws its icons from img/octicons-16.svg - so they are ~1.6 MB
of dead weight per version directory. Delete them after every build. -->
<execution>
<id>delete-unreferenced-assets</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete includeemptydirs="true">
<fileset dir="${refdocs.build.directory}">
<include name="fonts/**"/>
<include name="v1/fonts/**"/>
<include name="v2/fonts/**"/>
<include name="**/css/font-awesome.css"/>
<include name="**/*.map"/>
</fileset>
</delete>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>