diff --git a/asciidoctorj-springboot-integration-test/springboot-app/build.gradle b/asciidoctorj-springboot-integration-test/springboot-app/build.gradle index d7931e46..fb9be404 100644 --- a/asciidoctorj-springboot-integration-test/springboot-app/build.gradle +++ b/asciidoctorj-springboot-integration-test/springboot-app/build.gradle @@ -2,7 +2,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.springframework.boot.gradle.plugin.SpringBootPlugin plugins { - id 'org.springframework.boot' version '3.1.5' + id 'org.springframework.boot' version '3.3.4' id 'java' } diff --git a/docs/modules/guides/pages/run-with-springboot.adoc b/docs/modules/guides/pages/run-with-springboot.adoc index e3fb646f..d7ccd88f 100644 --- a/docs/modules/guides/pages/run-with-springboot.adoc +++ b/docs/modules/guides/pages/run-with-springboot.adoc @@ -1,27 +1,35 @@ = Running AsciidoctorJ with Spring Boot -:url-springboot-docs: https://docs.spring.io/spring-boot/docs/current +:url-springboot-docs: https://docs.spring.io/spring-boot/ +:url-asciidoctor-gh-org: https://github.com/asciidoctor Due to Spring Boot's packaging system, Asciidoctorj won't work out of the box from a single JAR application. Luckily Spring Boot plugins for Gradle and Maven provide options to fix it. +Below you can find the required configurations to apply to Maven and Gradle. +But read about {url-springboot-docs}/how-to/build.html#howto.build.extract-specific-libraries-when-an-executable-jar-runs[extracting libraries during runtime] for the details. + == Gradle configuration You just need to add the following configuration to your Gradle build. +This will include not only AsciidoctorJ but others that also require unpacking like {url-asciidoctor-gh-org}/asciidoctorj-pdf[asciidoctor-pdf] or {url-asciidoctor-gh-org}/asciidoctorj-diagram[asciidoctorj-diagram]. - -```groovy +[,groovy] +---- bootJar { requiresUnpack '**/asciidoctorj-*.jar' } -``` - -For full details, check the official {url-springboot-docs}/gradle-plugin/reference/htmlsingle/#packaging-executable-configuring-unpacking[Spring Boot Gradle Plugin documentation]. +---- == Maven configuration Similarly, for the Maven plugin add the following configuration to your POM. +However, unlike in Gradle, wildcards are not allowed and dependencies need to be described one by one. + +TIP: Run `mvn dependency:tree` to find all required dependencies, including transitive ones. +See this https://github.com/asciidoctor/asciidoctorj/issues/1286#issuecomment-2394769356[example] for a full configuration. -```xml +[,xml] +---- org.springframework.boot spring-boot-maven-plugin @@ -34,8 +42,4 @@ Similarly, for the Maven plugin add the following configuration to your POM. -``` - -For full details, check the official {url-springboot-docs}/maven-plugin/reference/htmlsingle/#goals-repackage[Spring Boot Maven Plugin documentation]. - - +----