Convert Maven javadoc command to Gradle javadoc command

Viewed 148

Introduction

I am currently working on a GitHub action that generates a JavaDoc and publish-it to GitHub, without need to configure JavaDoc inside the project.

Affected code:

mvn org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:aggregate

Problematic

The problem with this code is that does not work with Gradle project

Question

And I was wondering if it would be possible to be able to do the same with Gradle? ie to be able to use the JavaDoc generation without it being in the project configs.

2 Answers

I don't know what your project structure is, but in a default gradle project you should be able to generate Javadoc just with a gradle javadoc command without any changes to your project. The only requirement is that the java plugin is used.

All the other configurations described by @VonC are only needed if you want to select only specific files or if your project is not structured in a standard way.

Just try running gradle javadoc and look for the generated doc in build/docs/javadoc/ folder

Related