GH-1393 - Upgrade to Spring Docs Resources 0.2.4.

Polish Asciidoctor setup. Switch to source-highlighter attribute as the configuration option has been dropped [0]. Switch to improved way of consuming Spring Docs Resources and Spring Data build resources. Upgrade to latest versions of ASciidoctor Maven Plugin and its dependencies. Fixed PlantUML integration by explicitly registering the extension.

[0] https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/master/docs/v2-migration-guide.adoc#23-removal-of-sourcehighlighter
This commit is contained in:
Oliver Drotbohm
2020-11-10 14:40:07 +01:00
parent 0fa82fa020
commit b0b061e835
4 changed files with 34 additions and 60 deletions

88
pom.xml
View File

@@ -71,7 +71,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<source.level>1.8</source.level>
<assertj.version>3.18.0</assertj.version>
<docs.resources.version>0.2.2.RELEASE</docs.resources.version>
<docs.resources.version>0.2.4</docs.resources.version>
<spring.data.build.resources.version>2.4.0</spring.data.build.resources.version>
<evo.version>1.2.2</evo.version>
<logback.version>1.2.3</logback.version>
<jacoco>0.8.5</jacoco>
@@ -95,7 +96,7 @@
<id>spring-next</id>
<properties>
<reactor-bom.version>2020.0.0-SNAPSHOT</reactor-bom.version>
<spring.version>5.3.1-SNAPSHOT</spring.version>
<spring.version>5.3.2-SNAPSHOT</spring.version>
</properties>
</profile>
@@ -176,23 +177,6 @@
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>io.spring.docresources</groupId>
<artifactId>spring-doc-resources</artifactId>
<version>${docs.resources.version}</version>
<type>zip</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-build-resources</artifactId>
<version>2.4.0-SNAPSHOT</version>
<type>zip</type>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
@@ -202,34 +186,30 @@
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-doc-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<includeGroupIds>io.spring.docresources</includeGroupIds>
<includeArtifactIds>spring-doc-resources</includeArtifactIds>
<includeTypes>zip</includeTypes>
<excludeTransitive>true</excludeTransitive>
<url>https://repo.spring.io/release/io/spring/docresources/spring-doc-resources/${docs.resources.version}/spring-doc-resources-${docs.resources.version}.zip</url>
<unpack>true</unpack>
<outputDirectory>${generated-asciidoc-sources.directory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>unpack-shared-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<id>unpack-spring-data-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>spring-data-build-resources</includeArtifactIds>
<includeTypes>zip</includeTypes>
<excludeTransitive>true</excludeTransitive>
<url>https://repo.spring.io/release/org/springframework/data/build/spring-data-build-resources/${spring.data.build.resources.version}/spring-data-build-resources-${spring.data.build.resources.version}.zip</url>
<unpack>true</unpack>
<outputDirectory>${shared.resources}</outputDirectory>
</configuration>
</execution>
@@ -292,7 +272,7 @@
<fileset dir="src/main/asciidoc" includes="**/*.adoc"/>
</copy>
<copy failonerror="false"
todir="${generated-asciidoc-sources.directory}/images/">
todir="${generated-asciidoc-sources.directory}/images/">
<fileset dir="src/main/asciidoc/images"/>
</copy>
@@ -317,7 +297,7 @@
<!-- Copy files for the single-file HTML version -->
<copy failonerror="false"
todir="target/site/reference/html/images">
todir="target/site/reference/html/images">
<fileset dir="${generated-docs.directory}/images"/>
</copy>
@@ -342,11 +322,11 @@
<!-- Copy and rename the Epub file -->
<copy failonerror="false" file="${generated-docs.directory}/index.pdf"
tofile="target/site/reference/pdf/spring-hateoas-reference.pdf"/>
tofile="target/site/reference/pdf/spring-hateoas-reference.pdf"/>
<!-- Copy and rename the PDF file -->
<copy failonerror="false" file="${generated-docs.directory}/index.epub"
tofile="target/site/reference/epub/spring-hateoas-reference.epub"/>
tofile="target/site/reference/epub/spring-hateoas-reference.epub"/>
</target>
</configuration>
@@ -366,27 +346,17 @@
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.0.0-RC.1</version>
<version>2.1.0</version>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>9.2.6.0</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>2.0.0-RC.1</version>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-pdf</artifactId>
<version>1.5.0-alpha.16</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-epub3</artifactId>
<version>1.5.0-alpha.8.1</version>
<artifactId>asciidoctorj-diagram</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<executions>
@@ -402,16 +372,20 @@
<sourceDocumentName>index.adoc</sourceDocumentName>
<backend>html5</backend>
<outputDirectory>${generated-docs.directory}</outputDirectory>
<sourceHighlighter>highlight.js</sourceHighlighter>
<docinfo>shared</docinfo>
<attributes>
<highlightjsdir>js/highlight</highlightjsdir>
<highlightjs-theme>github</highlightjs-theme>
<linkcss>true</linkcss>
<sectanchors>true</sectanchors>
<source-highlighter>highlight.js</source-highlighter>
<stylesdir>./css</stylesdir>
<stylesheet>spring.css</stylesheet>
<toc>left</toc>
</attributes>
<requires>
<require>asciidoctor-diagram</require>
</requires>
</configuration>
</execution>
@@ -1117,8 +1091,8 @@
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<url>https://repo.spring.io/libs-snapshot</url>
<id>spring-snapshot</id>
<url>https://repo.spring.io/lib-snapshot</url>
</repository>
</repositories>

View File

@@ -153,7 +153,7 @@ If you returned such an instance from a Spring MVC or WebFlux controller and the
.The HAL representation generated for the person representation model
====
[source javscript]
[source, json]
----
{
"_links" : {

View File

@@ -7,7 +7,7 @@ Oliver Gierke; Greg Turnquist; Jay Bryant
This project provides some APIs to ease creating REST representations that follow the https://en.wikipedia.org/wiki/HATEOAS[HATEOAS] principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly.
(C) 2012-2019 The original authors.
(C) 2012-2020 The original authors.
NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

View File

@@ -72,7 +72,7 @@ return new ResponseEntity<PersonModel>(headers, HttpStatus.CREATED);
====
[[fundamentals.obtaining-links.builder.methods]]
==== Building links that point to methods
=== Building links that point to methods
You can even build links that point to methods or create dummy controller method invocations.
The first approach is to hand a `Method` instance to the `WebMvcLinkBuilder`.