3

I'm working on a Java project, which runs on GitLab. I'm trying to find a way, in which GitLab automatically generates the Java documentation on each push.

I tried to use the JavaDoc plugin for Maven and call it with a pipeline. But the plugin needs the file javadoc.exe, which is just local at my computer and not at GitLab.

Is there a possibility to run the plugin without this file. Or maybe an other option, to solve this problem?

Thanks!

1 Answers1

2

Option 1. Use JDK image which contains javadoc

Proof:

$ docker run -it --rm openjdk javadoc --version
javadoc 12.0.1

Example of GitLab CI job:

generate-doc:
  image: openjdk
  script:
    - javadoc ...

Option 2. Install javadoc via npm

See doc: https://www.npmjs.com/package/javadoc

Proof:

$ npm install -s javadoc
+ javadoc@1.0.6
added 235 packages from 100 contributors and audited 81 packages in 8.795s
found 0 vulnerabilities

$ javadoc --version
javadoc 12.0.1

Example of GitLab CI job:

generate-doc:
  image: node
  script:
    - npm install -s javadoc
    - javadoc ...
Ivan
  • 9,089
  • 4
  • 61
  • 74