6

By declaring the following dependency:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>

I can use about everything I need for a Java EE 6 Project (Servlet 3.0, JPA 2, EJB, CDI, etc). The problem is: Maven can not download the Javadocs for the dependency (or at least m2eclipse "Download JavaDoc" feature don't work), so Eclipse don't show me the Javadocs when I use the very handy code completion feature.

I've found this post specific to Servlet 3.0 API, Maven dependency for Servlet 3.0 API?.

Can anyone kindly point to a solution that works for every API? Or, can anyone please provide a dummy guide to install Java EE 6 Javadocs and link it to javaee-web-api artifact in the local repository?

Community
  • 1
  • 1
Anthony Accioly
  • 21,918
  • 9
  • 70
  • 118

1 Answers1

8

Assuming you have Java EE javadocs, you can install them to your local maven repository using the maven install plugin. Look at this usage link

You would use the -Dclassifier=sources to indicate you are installing sources. See this example for this.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • 12
    Great Stuff! Dummy guide: Download the Javadoc [here](http://www.oracle.com/technetwork/java/javaee/downloads/index.html). And Issue the following command to install (assuming that the jar file is in the current folder and it is called javadoc-6.0.1.jar): `mvn install:install-file -Dfile=javadoc-6.0.1.jar -DgroupId=javax -DartifactId=javaee-web-api -Dversion=6.0 -Dpackaging=jar -Dclassifier=javadoc`. If m2eclipse don't pick the changes (it didn't for me), reimport the project. – Anthony Accioly Jun 02 '11 at 06:29
  • 2
    Just curious. m2eclipse has a option to associate a Javadoc URL location to a Maven dependency. Can it be done in pure Maven? Or, at least, can I somehow point maven to install the javadocs from a URL (say http://download.oracle.com/javaee/6/api/). – Anthony Accioly Jun 02 '11 at 06:34
  • The link does not work because you have to accept the OTN licence before downloading. Use the followng link instead (is the previous page with the agreement) http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eedocs-419425.html – C.LS Nov 05 '14 at 12:30
  • If anyone is looking for Java EE 7 Documentation, [here are the jars](http://dlc.sun.com.edgesuite.net/glassfish/4.0/release) – Anthony Accioly May 20 '15 at 22:53