Skip to content

Commit 973f4c1

Browse files
committed
#126 - Upgraded to Asciidoctor 1.5.2 to get rid off Docbook.
Removed Docbook based PDF generation and set up ASciidoctor to render PDFs and EPUB. Updated README to reflect current state of functionality.
1 parent a7e3e9b commit 973f4c1

File tree

2 files changed

+61
-94
lines changed

2 files changed

+61
-94
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Spring Data Build Infrastructure
22

3-
This repository contains common infrastructure to be used by Spring Data modules that build with Maven. It consists of a *resources* project that bundles up resources that are needed during the build like XSLT stylesheets for reference documentation generation and the according CSS and images. The second project is *parent* that can be used as parent project to pre-configure core dependencies, properties, reference documentation generation and most important of all the appropriate distribution assembly.
3+
This repository contains common infrastructure to be used by Spring Data modules that build with Maven. It consists of a *resources* project that bundles up resources that are needed during the build CSS for reference documentation generation and JavaDoc. The second project is *parent* that can be used as parent project to pre-configure core dependencies, properties, reference documentation generation and most important of all the appropriate distribution assembly.
44

55
The parent project can be eased for either a single-module Maven project or a multi-module one. Each of the setups requires a slightly different setup of the project.
66

@@ -13,25 +13,18 @@ The parent project configures the following aspects of the project build:
1313
Shared resources are pulled in from the `spring-data-build-resources` dependency (images, CSS, XSLTs for documentation generation). Renders reference documentation from Docbook file named `index.xml` within `src/docbkx`. In the `distribute` profile, two assemblies are generated: A ZIP to be uploaded to static.springsource.org (incl. javadoc (browsable), reference docs as described before) with the following content:
1414

1515
```
16-
+ schemas -> containing all XSD namespace schemas
1716
- changelog.txt
1817
- license.txt
1918
- notice.txt
2019
- readme.txt
21-
+ docs
22-
+ reference -> Docbook generated reference documentation
20+
+ reference -> Docbook generated reference documentation
2321
+ html
24-
+ htmlsingle
2522
+ pdf
23+
+ epub
2624
+ api -> JavaDoc
2725
```
2826

29-
A second ZIP is generated to be uploaded to S3 to automatically make it into the downloads section on the Spring website. It contains the same content as listed above plus the following:
30-
31-
```
32-
+ src -> Sources packaged into a JAR
33-
+ dist -> Binary JARs
34-
```
27+
A second ZIP is generated to be uploaded to static.springsource.org to contain all Spring namespace XSDs.
3528

3629
The following dependencies are pre-configured.
3730

@@ -47,7 +40,7 @@ If the client project is a project consisting of a single project only all that
4740
<parent>
4841
<groupId>org.springframework.data.build</groupId>
4942
<artifactId>spring-data-parent</artifactId>
50-
<version>1.3.0.RELEASE</version>
43+
<version>${most-recent-release-version}</version>
5144
</parent>
5245
```
5346

@@ -89,7 +82,7 @@ As an example have a look at the build of [Spring Data MongoDB](http://github.co
8982
- `distribute` - Creates Docbook documentation, assembles the distribution zip, etc.
9083
- `milestone` - Configures the binary distribution to upload to the milestone S3 repository.
9184
- `release` - Configures the binary distribution to upload to the release S3 repository.
92-
- `spring32-next` - Configures the Spring version to be used to be the next 3.2.x snapshot version.
93-
- `spring4` - Configures the Spring version to be used to be the latest 4.x release version.
94-
- `spring4-next` - Configures the Spring version to be used to be the next 4.x snapshot version.
85+
- `spring4-next` - Configures the Spring version to be used to be the next 4.0.x snapshot version.
86+
- `spring41` - Configures the Spring version to be used to be the latest 4.1.x release version.
87+
- `spring41-next` - Configures the Spring version to be used to be the next 4.1.x release version.
9588
- `querydsl-next` - Configures the Querydsl version to be used to be the next available snapshot version.

parent/pom.xml

Lines changed: 53 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
Global parent pom.xml for Spring Data modules to inherit from.
77
88
- Shared resources are pulled in from the spring-data-build-resources dependency (images, CSS, XSLTs for documentation generation)
9-
- Renders reference documentation from Docbook file named index.xml within src/docbkx
10-
- In the "distribute" profile, two assemblies are generated:
11-
- one to be published on the download portal (incl. binaries, sources, javadoc (jarred and browsable), reference documentation in pdf, html and html single page)
9+
- Renders reference documentation from Asciidoctor file named index.adoc within src/main/asciidoc
10+
- In the "distribute" profile, an assembly is generated:
1211
- one to be uploaded to static.springsource.org (incl. javadoc (browsable), reference docs as described before)
1312
1413
Preconfigures the following:
@@ -45,9 +44,9 @@
4544
<developer>
4645
<id>ogierke</id>
4746
<name>Oliver Gierke</name>
48-
<email>ogierke at gopivotal.com</email>
47+
<email>ogierke at pivotal.io</email>
4948
<organization>Pivotal Software, Inc.</organization>
50-
<organizationUrl>http://www.gopivotal.com</organizationUrl>
49+
<organizationUrl>http://www.spring.io</organizationUrl>
5150
<roles>
5251
<role>Project lead</role>
5352
</roles>
@@ -207,60 +206,6 @@
207206
</executions>
208207
</plugin>
209208

210-
<!--
211-
Renders reference documentation from Docbook sources.
212-
-->
213-
214-
<plugin>
215-
<groupId>com.agilejava.docbkx</groupId>
216-
<artifactId>docbkx-maven-plugin</artifactId>
217-
<version>2.0.14</version>
218-
<executions>
219-
220-
<!-- Configuration for PDF creation -->
221-
<execution>
222-
<id>pdf</id>
223-
<goals>
224-
<goal>generate-pdf</goal>
225-
</goals>
226-
<phase>package</phase>
227-
<configuration>
228-
<admonGraphicsPath>${shared.resources}/docbkx/images/</admonGraphicsPath>
229-
<imgSrcPath>${basedir}/src/docbkx/</imgSrcPath>
230-
<postProcess>
231-
<copy todir="${project.build.directory}/site/reference">
232-
<fileset dir="${project.build.directory}/docbkx">
233-
<include name="**/*.pdf"/>
234-
</fileset>
235-
</copy>
236-
<move file="${project.build.directory}/site/reference/pdf/index.pdf" tofile="${project.basedir}/target/site/reference/pdf/${dist.id}-reference.pdf"/>
237-
</postProcess>
238-
</configuration>
239-
</execution>
240-
241-
</executions>
242-
243-
<dependencies>
244-
<dependency>
245-
<groupId>org.docbook</groupId>
246-
<artifactId>docbook-xml</artifactId>
247-
<version>4.4</version>
248-
<scope>runtime</scope>
249-
</dependency>
250-
</dependencies>
251-
252-
<!-- Common Docbook configuration -->
253-
<configuration>
254-
<sourceDirectory>${project.build.directory}/generated-docs</sourceDirectory>
255-
<includes>index.xml</includes>
256-
<xincludeSupported>true</xincludeSupported>
257-
<chunkedOutput>false</chunkedOutput>
258-
<foCustomization>${shared.resources}/docbkx/xsl/pdf.xsl</foCustomization>
259-
<useExtensions>1</useExtensions>
260-
<highlightSource>1</highlightSource>
261-
</configuration>
262-
</plugin>
263-
264209
<!--
265210
Copies all namespaces schemas to target/schemas flatten the directory structure.
266211
Depended on by the site.xml assembly descriptor.
@@ -298,15 +243,13 @@
298243
</execution>
299244

300245
<execution>
301-
<id>copy-documentation-images</id>
246+
<id>collect-schema-files</id>
302247
<phase>process-resources</phase>
303248
<configuration>
304249
<target>
305-
<copy todir="${shared.resources}/docbkx/images">
306-
<fileset dir="${basedir}/src/docbkx" erroronmissingdir="false">
307-
<include name="**/*.jpg"/>
308-
<include name="**/*.gif"/>
309-
<include name="**/*.png"/>
250+
<copy todir="${project.build.directory}/schemas">
251+
<fileset dir="${basedir}" erroronmissingdir="false">
252+
<include name="**/src/main/resources/**/config/spring-*.xsd"/>
310253
</fileset>
311254
<flattenmapper/>
312255
</copy>
@@ -318,22 +261,19 @@
318261
</execution>
319262

320263
<execution>
321-
<id>collect-schema-files</id>
264+
<id>rename-reference-docs</id>
322265
<phase>process-resources</phase>
323266
<configuration>
324267
<target>
325-
<copy todir="${project.build.directory}/schemas">
326-
<fileset dir="${basedir}" erroronmissingdir="false">
327-
<include name="**/src/main/resources/**/config/spring-*.xsd"/>
328-
</fileset>
329-
<flattenmapper/>
330-
</copy>
268+
<copy file="${project.build.directory}/generated-docs/index.pdf" tofile="${project.basedir}/target/site/reference/pdf/${dist.id}-reference.pdf"/>
269+
<copy file="${project.build.directory}/generated-docs/index.epub" tofile="${project.basedir}/target/site/reference/epub/${dist.id}-reference.epub"/>
331270
</target>
332271
</configuration>
333272
<goals>
334273
<goal>run</goal>
335274
</goals>
336275
</execution>
276+
337277
</executions>
338278

339279
</plugin>
@@ -351,6 +291,23 @@
351291
<groupId>org.asciidoctor</groupId>
352292
<artifactId>asciidoctor-maven-plugin</artifactId>
353293
<version>1.5.0</version>
294+
<dependencies>
295+
<dependency>
296+
<groupId>org.asciidoctor</groupId>
297+
<artifactId>asciidoctorj</artifactId>
298+
<version>1.5.2</version>
299+
</dependency>
300+
<dependency>
301+
<groupId>org.asciidoctor</groupId>
302+
<artifactId>asciidoctorj-pdf</artifactId>
303+
<version>1.5.0-alpha.6</version>
304+
</dependency>
305+
<dependency>
306+
<groupId>org.asciidoctor</groupId>
307+
<artifactId>asciidoctorj-epub3</artifactId>
308+
<version>1.5.0-alpha.4</version>
309+
</dependency>
310+
</dependencies>
354311
<executions>
355312

356313
<execution>
@@ -361,27 +318,39 @@
361318
</goals>
362319
<configuration>
363320
<backend>html5</backend>
364-
<sourceHighlighter>prettify</sourceHighlighter>
365321
<outputDirectory>${project.root}/target/site/reference/html</outputDirectory>
322+
<sectids>false</sectids>
323+
<sourceHighlighter>prettify</sourceHighlighter>
366324
<attributes>
367325
<linkcss>true</linkcss>
368-
<numbered>true</numbered>
369326
<icons>font</icons>
370327
<sectanchors>true</sectanchors>
371328
<stylesheet>spring.css</stylesheet>
372-
<toclevels>3</toclevels>
373329
</attributes>
374330
</configuration>
375331
</execution>
376332

377333
<execution>
378-
<id>docbook</id>
334+
<id>epub</id>
379335
<phase>generate-resources</phase>
380336
<goals>
381337
<goal>process-asciidoc</goal>
382338
</goals>
383339
<configuration>
384-
<backend>docbook5</backend>
340+
<backend>epub3</backend>
341+
<sourceHighlighter>coderay</sourceHighlighter>
342+
</configuration>
343+
</execution>
344+
345+
<execution>
346+
<id>pdf</id>
347+
<phase>generate-resources</phase>
348+
<goals>
349+
<goal>process-asciidoc</goal>
350+
</goals>
351+
<configuration>
352+
<backend>pdf</backend>
353+
<sourceHighlighter>coderay</sourceHighlighter>
385354
</configuration>
386355
</execution>
387356

@@ -399,7 +368,8 @@
399368
<querydslVersion>${querydsl}</querydslVersion>
400369
<springVersion>${spring}</springVersion>
401370
<allow-uri-read>true</allow-uri-read>
402-
<sectids>false</sectids>
371+
<toclevels>3</toclevels>
372+
<numbered>true</numbered>
403373
</attributes>
404374
</configuration>
405375

@@ -660,7 +630,7 @@
660630
</plugin>
661631

662632
<plugin>
663-
<groupId>org.apache.maven.plugins</groupId>
633+
<groupId>org.apache.maven.plugins</groupId>
664634
<artifactId>maven-compiler-plugin</artifactId>
665635
<version>3.1</version>
666636
<configuration>
@@ -771,6 +741,10 @@
771741
<id>spring-plugins-release</id>
772742
<url>https://repo.spring.io/plugins-release</url>
773743
</pluginRepository>
744+
<pluginRepository>
745+
<id>jcenter</id>
746+
<url>https://dl.bintray.com/asciidoctor/maven</url>
747+
</pluginRepository>
774748
</pluginRepositories>
775749

776750
</project>

0 commit comments

Comments
 (0)