Maven 2: Deploying Javadoc with your project
When you deploy your project to remote repository you may want to include the project documentation and deploy it codes along with the project JAR file so that people would be able to download the JAR with Javadoc using Eclipse plug-in. It comes very handy when you use IDE like Eclipse or IDEA. Unfortunately by default Maven 2 does not deploy your source codes when you execute “deploy” goal.
This is how you can accomplish this. You need to configure Javadoc plug-in in your POM file
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<!-- Add this if you use Java 5 -->
<configuration>
<javadocVersion>1.5</javadocVersion>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Add this if you use Java 5 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<compilerVersion>1.5</compilerVersion>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>


