From b8a34e174729df830525beb9f365d0729ba7df62 Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Fri, 29 Dec 2023 18:48:07 +0100 Subject: [PATCH] Fix and test Javadoc generation (#708) --- .github/workflows/build.yaml | 20 +++++++++++++++++++ CHANGELOG.adoc | 1 + .../maven/process/CopyResourcesProcessor.java | 2 +- .../processors/AbstractSinkNodeProcessor.java | 5 ++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ec6828d2..0afa37cd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -45,3 +45,23 @@ jobs: run: mvn -version - name: Build & Test run: mvn -B -Prun-its clean verify + javadocs: + name: Javadocs + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + java: + - 11 + maven: + - 3.9.6 + runs-on: ${{ matrix.os }} + steps: + - uses: s4u/setup-maven-action@v1.11.0 + with: + java-distribution: 'temurin' + java-version: ${{ matrix.java }} + maven-version: ${{ matrix.maven }} + - name: Build & Test + run: mvn -B clean javadoc:jar diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index dad9dcc8..4c7dcc3f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -40,6 +40,7 @@ Build / Infrastructure:: * Add Java 21 to CI (#664) * Add Dependabot to automate dependency management (#669) * Improvements to dependency management (#690) + * Test Javadoc generation in CI (#690) Documentation:: diff --git a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/process/CopyResourcesProcessor.java b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/process/CopyResourcesProcessor.java index 9dc2d818..ee07883a 100644 --- a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/process/CopyResourcesProcessor.java +++ b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/process/CopyResourcesProcessor.java @@ -17,7 +17,7 @@ /** * {@link ResourcesProcessor} implementation that copies all valid resources from * a source directory to an output one. - *

+ *

* Following resources are not valid: * - AsciiDoc documents: based on file extension. * - Asciidoctor Docinfo files. diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java index 71cb8f6d..b49c5ed3 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java @@ -18,7 +18,10 @@ protected Sink getSink() { /** * Tests for the presence of an attribute in current and parent nodes. - * Returns first match. + * + * @param name attribute name + * @param node node to check + * @return true if attribute is found */ protected boolean hasAttribute(String name, ContentNode node) { ContentNode current = node;