Fix Asciidoctor ServiceLoader in managed environments like Wildfly
MODIFY
asciidoctorj-api/src/main/java/org/asciidoctor/Asciidoctor.java
asciidoctorj-api/src/main/java/org/asciidoctor/Asciidoctor.java
@@ -460,6 +460,10 @@ public interface Asciidoctor {
public static Asciidoctor create() {
ServiceLoader<Asciidoctor> asciidoctorImpls = ServiceLoader.load(Asciidoctor.class);
Iterator<Asciidoctor> iterator = asciidoctorImpls.iterator();
+ if (!iterator.hasNext()) {
+ asciidoctorImpls = ServiceLoader.load(Asciidoctor.class, Factory.class.getClassLoader());
+ iterator = asciidoctorImpls.iterator();
+ }
if (iterator.hasNext()) {
Asciidoctor impl = iterator.next();
List<Asciidoctor> remainingImpls = new ArrayList<>();

Fix Asciidoctor ServiceLoader in managed environments like Wildfly