Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(main) Update 'Running with Spring Boot' docs #1288

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
28 changes: 16 additions & 12 deletions docs/modules/guides/pages/run-with-springboot.adoc
Original file line number Diff line number Diff line change
@@ -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]
----
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -34,8 +42,4 @@ Similarly, for the Maven plugin add the following configuration to your POM.
</requiresUnpack>
</configuration>
</plugin>
```

For full details, check the official {url-springboot-docs}/maven-plugin/reference/htmlsingle/#goals-repackage[Spring Boot Maven Plugin documentation].


----
Loading