asciidoctor-maven-plugin icon indicating copy to clipboard operation
asciidoctor-maven-plugin copied to clipboard

Doxia error message shows invalid line "-1"

Open abelsromero opened this issue 5 years ago • 2 comments

Filed an issue upstream: https://issues.apache.org/jira/browse/DOXIA-611

In current development we show the line during the processing of the error, so the users the the information.

[ERROR] asciidoctor: ERROR: line 42: include file not found: /home/----/github/asciidoctor-maven-examples/asciidoc-maven-site-example/src/site/asciidoc/INVALID

However, in the actual Doxia error message, a line "-1" is shown.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-cli) on project asciidoc-maven-site-example: Error parsing '/home/----/github/asciidoctor-maven-examples/asciidoc-maven-site-example/src/site/asciidoc/article.adoc': line [-1] Found 1 issue(s) of severity DEBUG or higher during rendering -> [Help 1]

The real issue here is that we can capture multiples issues but doxia only accepts 1 line number. We can always pass any arbitrary line from the errors captured, but seems too (as said) arbiratry.

abelsromero avatar Jun 14 '20 21:06 abelsromero

Fix merged upstream: https://github.com/apache/maven-doxia-sitetools/pull/16/

abelsromero avatar Jul 04 '20 14:07 abelsromero

The fix has not yet been released, and contrary to what is mentioned in https://issues.apache.org/jira/browse/DOXIA-611 it's in v1.10. It's still possible to override doxia-site-renderer as in the example, but I am not sure this is a good approach. Asked for advice in the jira issue.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.9.1</version>
                <configuration>
                    <!-- Disable generateReports if you don't want to include the built-in reports -->
                    <generateReports>true</generateReports>
                    <generateSitemap>true</generateSitemap>
                    <relativizeDecorationLinks>false</relativizeDecorationLinks>
                    <locales>en</locales>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <asciidoc>
                        <!-- Optional site-wide AsciiDoc attributes -->
                        <attributes>
                            <icons>font</icons>
                            <source-highlighter>coderay</source-highlighter>
                            <coderay-css>style</coderay-css>
                            <toclevels>2</toclevels>
                        </attributes>
                        <logHandler>
                            <outputToConsole>false</outputToConsole>
                            <failIf>
                                <severity>DEBUG</severity>
                            </failIf>
                        </logHandler>
                    </asciidoc>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>${asciidoctor.maven.plugin.version}</version>
                    </dependency>
                    <!-- Comment this section to use the default jruby artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj</artifactId>
                        <version>${asciidoctorj.version}</version>
                    </dependency>
<!-- Force version that contains fix since site-plugin still uses 1.9.2
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-site-renderer</artifactId>
                        <version>1.10</version>
                    </dependency>
-->
                </dependencies>
            </plugin>

abelsromero avatar Dec 21 '21 19:12 abelsromero