1

I have a question concerning the maven javadoc plugin? I have configured that plugin with this values:

<build>

 ....

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.9</version>
    <configuration>
        <noqualifier>all</noqualifier>
        <reportOutputDirectory>${basedir}/MyDoc/javadoc</reportOutputDirectory>
        <destDir>javadoc</destDir>
    </configuration>
    <executions>
       <execution>
          <id>attach-javadocs</id>
          <goals>
             <goal>javadoc</goal>
           </goals>
        </execution>
     </executions>
 </plugin>      

 ...

</build>    

Is there a way to create some kind of documentation, if I use the command mvn clean install? I don´t want to create a Jar File with my JavaDoc documentation, I need a way to create the JavaDoc and put the created source file directly in my maven project.

Thanks !

Greetz Marwief

1 Answers1

5

To execute plugin during certain phase, add <phase> to <execution>. Plugin should be fired:

<executions>
   <execution>
      <id>attach-javadocs</id>
      <phase>install</phase>    <------ HERE
      <goals>
         <goal>javadoc</goal>
       </goals>
    </execution>
 </executions>

More on maven lifecycle here

kamil
  • 3,482
  • 1
  • 40
  • 64
  • That works fine! Many thanks! But now i get this information: "Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-javadoc-plugin:2.9:javadoc (execution: attach-javadocs, phase: compile)". Is there a way to solve this problem? –  Sep 17 '14 at 06:56
  • Are you using Eclipse? I tried with IntelliJ and in command line, and no error, this may help you: http://mahichir.wordpress.com/2014/05/14/solving-the-plugin-execution-not-covered-by-lifecycle-configuration-error-in-eclipse/ – kamil Sep 17 '14 at 07:03