How to generate automatically a JavaDoc on a web page [duplicate]
Asked Answered
B

2

9

I am currently working on a Java project in GitHub and I need on every update to manually generate JavaDoc and upload it on GitHub Page. But it’s very tedious.

And I wondering if is possible to automatise this with a CI?

Butta answered 9/6, 2022 at 19:16 Comment(1)
this question is duplicate: #70992206Bleat
R
13

Generate automatically a JavaDoc to a web page with GitHub Page

Yes is possible, with this code on your GitHub Actions :

name: Deploy Javadoc

on:
  push:
    branches:
      - master
      - main

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy JavaDoc 🚀
        uses: MathieuSoysal/[email protected]
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          javadoc-branch: javadoc
          java-version: 17
          target-folder: javadoc
          project: maven # or gradle 

Credit: https://github.com/MathieuSoysal/Javadoc-publisher.yml https://github.com/marketplace/actions/deploy-javadoc

This code publishes JavaDoc automatically when you publish your code to "master" branch, your JavaDoc is pushed on javadoc branch, and deployed with GitHub Page.

don't forget to enable GitHub page on your GitHub repo settings


Create a GitHub Actions inside your GitHub repository

To create a GitHub Actions you need to simply add this yaml file on /.github/workflows/<your-file>.yaml inside your GitHub repository.

Rae answered 9/6, 2022 at 20:29 Comment(0)
B
-1

We can use javadoc tool:
With a maven plugin: maven-javadoc-plugin

ttys000:am ➜  ~ javadoc -d doc src\*

Javadoc alternatives:
...
MkDocs. Free • Open Source.
Doxygen. Free • Open Source.
Slate API Docs Generator. Free • Open Source.
DocFX. Free • Open Source.
Sandcastle.
phpDocumentor
NDoc
DoxyS

Bleat answered 14/12, 2022 at 21:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.