asciidoctor / asciidoctor-maven-examples

A collection of example projects that demonstrates how to use the Asciidoctor Maven plugin.
http://asciidoctor.org/docs/asciidoctor-maven-plugin
Other
197 stars 243 forks source link

Cannot get my asciidoc to consistently read in Maven properties #130

Closed rickbansal-mulesoft closed 2 years ago

rickbansal-mulesoft commented 2 years ago

Hi, not sure what I'm doing wrong but I cannot get my asciidoc to consistently read in Maven properties define in my pom.xml file.

Here's a snipped of the pom file:

`

1.9.1 MM-dd-yyyy org.mule.extensions mule-modules-parent 1.1.3 org.apache.maven.plugins maven-source-plugin attach-sources jar org.asciidoctor asciidoctor-maven-plugin 2.2.2 asciidoc-to-html generate-resources process-asciidoc ${project.version} ${maven.build.timestamp} coderay ` And here is a bit of the asciidoc: `= Mule 4 OpenTelemetry (OTel) Agent Extension // Document header Rick Bansal :revnumber: {revnumber} :revdate: {revdate} :revremark: Initial Draft :doctype: book :icons: font :toc: left :keywords: Mule, MuleSoft, Observability, OpenTelemetry, OTel, Tracing, Instrumentation, Distributed` Image of the html output: Screen Shot 2022-02-28 at 10 34 06 AM Please advise. Thanks
abelsromero commented 2 years ago

I could no see any issues with your configuration, but also this is not complete. Could be some parent project or other configuration is overriding the attributes somehow? Can you share or point to a full project?

I applied the attributes to your file succesfully. I only removed the rev attributes from the header section (no need to re-define those), and displayed the attributes also in the section at the bottom.

= Mule 4 OpenTelemetry (OTel) Agent Extension
// Document header
Rick Bansal <rick.bansal@mulesoft.com>
:revremark: Initial Draft
:doctype: book
:icons: font
:toc: left
:keywords: Mule, MuleSoft, Observability, OpenTelemetry, OTel, Tracing, Instrumentation, Distributed

== Values

revnumber: {revnumber}
revdate: {revdate}

image

PS: you can use markdown code blocks for examples (3 ticks ```), that will keep the format https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#fenced-code-blocks.

rickbansal-mulesoft commented 2 years ago

Abel, thanks for your response. I've attached the entire (effective) pom.xml file for your reference. Btw, I'm using the AsciiDoctor Eclipse plug-in and not sure if that maters.

Screen Shot 2022-02-28 at 4 44 03 PM

pom-xml.txt

abelsromero commented 2 years ago

AsciiDoctor Eclipse plug-in and not sure if that maters.

For my testing I am running the maven build from terminal. Afaik the eclipse plugin is a separate component only for the preview which does not read maven configurations. Is your capture from maven build or the eclipse preview?

I could not run your pom, it still holds some references to other poms but the maven section seems complete.

rickbansal-mulesoft commented 2 years ago

From the maven build, executed through eclipse (I.e., not from the command line)

Sent from my iPhone

On Mar 1, 2022, at 2:53 AM, Abel Salgado Romero @.***> wrote:

 AsciiDoctor Eclipse plug-in and not sure if that maters.

For my testing I am running the maven build from terminal. Afaik the eclipse plugin is a separate component only for the preview which does not read maven configurations. Is your capture from maven build or the eclipse preview?

I could not run your pom, it still holds some references to other poms but the maven section seems complete.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.

abelsromero commented 2 years ago

I know it's tedious, but can you run from terminal to confirm eclipse is not messing? what the plugin does is quite simple, just inject project properties as-is https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/0aa5121249890c5db7c78b7c82e2ad387f38719e/src/main/java/org/asciidoctor/maven/process/AsciidoctorHelper.java#L35 (with some formatting that does not apply to your case). And I don't see anything in the pom, but without being able to run it locally I cannot debug further. Do you think you could create a reproducible project if this appears from terminal too?

rickbansal-mulesoft commented 2 years ago

I've cleaned up my pom.xml to remove some of the warnings that I was getting and seems like things are working as expected wrt to asciidoctor. thanks.

abelsromero commented 2 years ago

If you have any other questions or experience that does not quite match a bug, feel free to drop by https://asciidoctor.zulipchat.com/