https://discuss.asciidoctor.org/Maven-plugin-and-extensions-tp3149p3202.html
Sebastien,
You are now bumping into an intersection of several issues, so I'll try to explain it carefully and give you a rope to climb out to daylight.
First, it's important to understand that AsciidoctorJ bundles the necessary gems you need to use Asciidoctor, so you don't need any gems on your system. You don't even need Ruby. In fact, the gems on your system aren't used by default (though there is a way to request that they be used).
When the Maven plugin runs, it uses the gems bundled with AsciidoctorJ. The version of Slim that is bundled with AsciidoctorJ 1.5.2 is Slim 2.0.3. Out of the box, you _can_ use custom Slim templates with this version of Slim. However, you _cannot_ use the set of Slim templates provided at
https://github.com/asciidoctor/asciidoctor-backends. Those templates require Slim 2.1.0 or above. The reason they require (and enforce) Slim 2.1.0 or above is because they are using the new "include" feature in Slim to keep the templates DRY.
You have two option to climb out of this hole.
1) You can write your own Slim 2.0-compatible templates. Basically, start from scratch and you'll know when you are using a feature you can't use. You don't need to change anything else, but obviously it is a lot of work to start from scratch :/
Keep in mind that you only need to provide templates for the nodes you are changing. If a template is missing, Asciidoctor will fallback to using the built-in convert handler for that node. This might be the right solution for you since you only need to customize ulist.html.slim.
2) You can force AsciidoctorJ to use a newer version of Slim. This is a more involved setup, but once it's setup, you'll be able to use any Slim templates you want.
2a) Add the RubyGems proxy repository to your pom.xml (parent node: project)
<repositories>
<repository>
<id>rubygems-proxy-releases</id>
<name>RubyGems.org Proxy (Releases)</name>
</repository>
</repositories>
2b) Add a dependency on the Slim gem (any version you want) (parent node: project)
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>slim</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
<type>gem</type>
<exclusions>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>tilt</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
2c) Add the gem-maven-plugin to download and extract the Slim gem and its dependencies (parent node: project > build > plugins)
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>1.0.10</version>
<configuration>
<jrubyVersion>1.7.16.1</jrubyVersion>
<gemHome>${project.build.directory}/gems</gemHome>
<gemPath>${project.build.directory}/gems</gemPath>
</configuration>
<executions>
<execution>
<goals>
<goal>initialize</goal>
</goals>
</execution>
</executions>
</plugin>
2d) Configure the Asciidoctor Maven plugin to add the path to the extracted gems to the classpath (inside the <configuration> element)
<gemPath>${project.build.directory}/gems-provided</gemPath>
I hope that helps!
Abel, we may want to think about adding a dedicated tutorial to the Maven plugin repository that details how to use your own gems (which covers numerous use cases).