Search code examples
mavenmaven-site-pluginasciidoctor

Rendering AsciiDoctor doc with includes within Maven Site run


I use the Maven Site plugin to generate and to include AsciiDoctor based documentation in our Maven site. This works fine if the AsciiDoctor source file does not include any other AsciiDoctor files.

But if I want to include any other files like shown below AsciiDoctor does not find 050-gitworkflow.adoc.

include::050-gitworkflow.adoc[]

Instead I can see the following message generated by Maven

[INFO] --- maven-site-plugin:3.4:site (default-site) @ tamaya-all ---
[INFO] Parent project loaded from repository: org.apache:apache:pom:17
[WARNING] Unable to find a URL to the parent project. The parent menu will NOT be added.
[INFO] Relativizing decoration links with respect to project URL: http://tamaya.incubator.apache.org
[INFO] Rendering site with lt.velykis.maven.skins:reflow-maven-skin:jar:1.1.1 skin.
[INFO] Rendering 4 Doxia documents: 3 asciidoc, 1 markdown
asciidoctor: WARNING: <stdin>: line 20: include file not found: /Users/obf/apache/tamaya/devguide/050-gitworkflow.adoc

So it seems so that AsciiDoctor or assumes that the root directory for the documentation is the same as the Maven module basedirectory.

How can I use relative includes in the main Asciidoctor file?


Solution

  • The path should be relative to the directory you're running maven from, unless that's changed since we first added the ability to generate sites in the plugin. Have you tried using the baseDir or relativeBaseDir attributes? You can read more about them in the readme. If it still isn't working, I would consider that a bug and an issue should be filed.