asciidoctor / asciidoctorj-diagram

AsciidoctorJ Diagram bundles the Asciidoctor Diagram RubyGem (asciidoctor-diagram) so it can be loaded into the JVM using JRuby.
Apache License 2.0
10 stars 6 forks source link

Set path to plantuml.jar #16

Closed ioplker closed 3 years ago

ioplker commented 3 years ago

Hi! According to Asciidoctor docs we can specify path to plantuml.jar. But I see this attribute is not used at all. I write something like this in pom.xml:

<plugin>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-plugin</artifactId>
    <version>2.1.0</version>
    <executions>
        <execution>
            <id>convert-to-html</id>
            <phase>generate-resources</phase> 
            <goals>
                <goal>process-asciidoc</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.directory}/html</outputDirectory> 
                <attributes> 
                    ...
                    <java>plantuml.jar<java>
                </attributes>
            </configuration>
        </execution>
    </executions>
</plugin>
robertpanzer commented 3 years ago

If I understand the docs correctly you set the path to java with the java attribute. This is more interesting when running asciidoctor-diagram in a Ruby environment though.

Looking at the sources of asciidoctor-diagram [1] I wonder though if you can set the environment variable DIAGRAM_PLANTUML_CLASSPATH to your own plantuml.jar. Did you try that?

[1] https://github.com/asciidoctor/asciidoctor-diagram/blob/master/lib/asciidoctor-diagram/plantuml/converter.rb#L11

ioplker commented 3 years ago

@robertpanzer thanks a lot! It works for me :+1: Closing issue, although I think that is not the proper way to set it up.