diff --git a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
index af35a595f5f..b598b6be97e 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java
@@ -46,6 +46,7 @@ import org.springframework.util.StringUtils;
*
*
* - All warnings are made fatal.
+ *
- The version of AsciidoctorJ is upgraded to 2.4.1.
*
- A task is created to resolve and unzip our documentation resources (CSS and
* Javascript).
*
- For each {@link AsciidoctorTask} (HTML only):
@@ -69,10 +70,13 @@ import org.springframework.util.StringUtils;
*/
class AsciidoctorConventions {
+ private static final String ASCIIDOCTORJ_VERSION = "2.4.1";
+
void apply(Project project) {
project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> {
configureDocResourcesRepository(project);
makeAllWarningsFatal(project);
+ upgradeAsciidoctorJVersion(project);
UnzipDocumentationResources unzipResources = createUnzipDocumentationResourcesTask(project);
project.getTasks().withType(AbstractAsciidoctorTask.class, (asciidoctorTask) -> {
configureCommonAttributes(project, asciidoctorTask);
@@ -110,6 +114,10 @@ class AsciidoctorConventions {
project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*");
}
+ private void upgradeAsciidoctorJVersion(Project project) {
+ project.getExtensions().getByType(AsciidoctorJExtension.class).setVersion(ASCIIDOCTORJ_VERSION);
+ }
+
private UnzipDocumentationResources createUnzipDocumentationResourcesTask(Project project) {
Configuration documentationResources = project.getConfigurations().maybeCreate("documentationResources");
documentationResources.getDependencies()