Nouvan Shebubakar
Nouvan Shebubakar

Reputation: 11

Anyone can help me to fix this javadoc with maven plugin?

I found out that Maven can generate javadoc for me, and i put this plugin where i got from the internet

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.6.2</version>
  <configuration>
   <source>1.8</source>
   <target>1.8</target>
  </configuration>
 <tags>
   ...
 </tags>
</plugin>

and it seems it doesn't work with the plugin or i just missing out on something also when i hover on the version, it says

Description : The version (or valid range of versions) of the plugin to be used. 
Version : 4.0.0+

I'm expectin to have javadoc for my classes, methods and datafields using Maven.

Upvotes: 0

Views: 111

Answers (1)

Andrey B. Panfilov
Andrey B. Panfilov

Reputation: 6111

By default, specifying plugin in build section of pom.xml without configuring execution does not cause maven to trigger plugin execution during build lifecycle, the exception is default plugin bindings in maven distro, when maven itself assigns particular plugins and their goals to build lifecycle.

Basically, you need to specify what goal of maven-javadoc-plugin is required to execute during build lifecycle, typical configuration would be following:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.6.2</version>
  <executions>
    <execution>
        <id>attach_docs</id>
        <goals>
            <goal>jar</goal>
        </goals>
    </execution>
  </executions>
  <configuration>
   <source>1.8</source>
   <target>1.8</target>
  </configuration>
 <tags>
   ...
 </tags>
</plugin>

Upvotes: 0

Related Questions