Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix javadoc generation for aggregator projects #28

Conversation

pSub
Copy link
Collaborator

@pSub pSub commented Feb 3, 2023

Commit e4e88da changes the behaviour of the Apache javadoc plugin to the standard Maven goal. This works well for simple maven projects but fails on aggregator projects. This commit reverts to the old behaviour and uses the goal javadoc:aggregate.

Closes issue #26.

Commit e4e88da changes the behaviour
of the Apache javadoc plugin to the standard Maven goal. This works
well for simple maven projects but fails on aggregator projects. This
commit reverts to the old behaviour and uses the goal
`javadoc:aggregate`.

Closes issue MathieuSoysal#26.
@pSub
Copy link
Collaborator Author

pSub commented Feb 3, 2023

The javadoc Maven goals are document at https://maven.apache.org/plugins/maven-javadoc-plugin/.

Copy link
Owner

@MathieuSoysal MathieuSoysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the GitHub workflow can you update on: [push] to on: [push, pull_request] and remove the line custom-command: javadoc:javadoc ?

name: Test Actions

on: [push, pull_request]

jobs:
  check-pom:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: GuillaumeFalourd/assert-command-line-output@v2
        with:
          command_line: cat pom.xml
          contains: JAVAVERSION

  test-for-github-workflow: # Test the action with the GitHub workflow
    needs: check-pom
    continue-on-error: true
    strategy:
      matrix:
        java: [8, 11, 16, 17, 18, 19]
        java-distribution: [adopt, zulu, temurin, corretto, microsoft, liberica]
        os: [ubuntu-latest, windows-latest, macos-latest]
        project: [maven, gradle]
        exclude:
          - java: 8
            java-distribution: microsoft
          - java: 18
            java-distribution: microsoft
          - java: 19
            java-distribution: microsoft
          - java: 19
            project: gradle
            os: windows-latest
    runs-on: ${{ matrix.os }}

    name: Test Java ${{ matrix.java }} ${{ matrix.java-distribution }} ${{ matrix.project }} - ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3

      - name: Replace string in file
        uses: MathieuSoysal/replace-string-in-file@v1.0.0
        with:
          file: pom.xml
          old-string: JAVAVERSION
          new-string: ${{ matrix.java }}

      - uses: ./ # Uses an action in the root directory
        if: ${{ matrix.project == 'maven' }}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          javadoc-branch: javadoc-test
          java-version: ${{ matrix.java }}
          target-folder: javadoc
          project: ${{ matrix.project }}
          java-distribution: ${{ matrix.java-distribution }}
          without-deploy: true
          without-checkout: true

      - uses: ./ # Uses an action in the root directory
        if: ${{ matrix.project == 'gradle' }}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          javadoc-branch: javadoc-test
          java-version: ${{ matrix.java }}
          target-folder: javadoc
          project: ${{ matrix.project }}
          java-distribution: ${{ matrix.java-distribution }}
          without-deploy: true
          without-checkout: true
          custom-command: gradle javadoc

      - uses: GuillaumeFalourd/assert-command-line-output@v2
        if: ${{ matrix.project == 'maven' }}
        with:
          command_line: cat target/site/apidocs/index.html
          contains: javadoc

      - uses: GuillaumeFalourd/assert-command-line-output@v2
        if: ${{ matrix.project == 'gradle' }}
        with:
          command_line: cat build/docs/javadoc/index.html
          contains: javadoc

I don't have the autorisation to update your branch.

@MathieuSoysal
Copy link
Owner

MathieuSoysal commented Feb 7, 2023

I can add it once the pull-request was merged.

Thank you for your contribution! 🚀

@MathieuSoysal MathieuSoysal merged commit da6dbc6 into MathieuSoysal:main Feb 7, 2023
@pSub pSub deleted the fix-javadoc-generation-for-aggregator-projects branch February 7, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants