Search code examples
maven-site-pluginasciidoctor

Overhanding properties when rendering Asciidoctor documents with Maven Site plugin


My Maven site contains serveral Asciidoctor documents. I would like to use the properites declared in the configuration of the Maven Site plugin, but it seems so that they are not overhanded to Asciidoctor.

<plugin>

  <artifactId>maven-site-plugin</artifactId>

  <dependencies>
        
    <dependency>
      <groupId>org.asciidoctor</groupId>
            
      <artifactId>asciidoctor-maven-plugin</artifactId>
                 
    </dependency>
        
              
  </dependencies>
    
  <configuration>
        
    <attributes>

      <ta>ddd</ta>

    </attributes>
    
  </configuration>
</plugin>


Here is an example how I try to use the attribute ta in my Asciidoctor documents.

= Example Document

Value of ta is: {ta}

How can I use the attributes defined for Maven Site plugin in my Asciidoctor documents?


Solution

  • At the moment (as of AsciidoctorJ 1.52) it is not possible to use the attributes of Maven Site in Asciidoctor documents.

    I filed an issue on this (https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/170).

    For the time being I found a workarount. I use the resouces plugin to write all properties to a file and include this file in my documents. A workaround. A direkt access to defined attributes would be more convenient.