Coping with Sun JARs

Often users are confronted with the need to build against JARs provide by Sun like the JavaMail JAR, or the Activation JAR and users have found these JARs not present in central repository resulting in a broken build. Unfortunately most of these artifacts fall under Sun's Binary License which disallows us from distributing them from Ibiblio.

Another problem is that Sun's appears not to have any sort of convention for naming their own JARs so we have taken steps in suggesting some common names for Sun's artifacts. You can find a list of our suggestions here:

Product artifactGroup IDArtifact ID
Java Activation Frameworkjavax.activationactivation
J2EEjavax.j2eej2ee
Java Data Object (JDO)javax.jdojdo
Java Message Service (JMS)javax.jmsjms
JavaMailjavax.mailmail
Java Persistence API (JPA) / EJB 3javax.persistencepersistence-api
J2EE Connector Architecturejavax.resourceconnector
J2EE Connector Architecture APIjavax.resourceconnector-api
Java Authentication and Authorization Service (JAAS)javax.securityjaas
Java Authorization Contract for Containersjavax.securityjacc
Servlet APIjavax.servletservlet-api
Servlet JavaServer Pages (JSP)javax.servletjsp-api
Servlet JavaServer Pages Standard Tag Library (JSTL)javax.servletjstl
JDBC 2.0 Optional Packagejavax.sqljdbc-stdext
Java Transaction API (JTA)javax.transactionjta
Java XML RPCjavax.xmljaxrpc
Portletjavax.portletportlet-api
Java Naming and Directory Interface (JNDI)javax.namingjndi

If you use our suggestions as noted above when adding a Sun dependency to your POM, Maven 2.x can help you locate the JARs by providing the site where they can be retrieved. It is important that you follow the suggested naming conventions as we cannot store the JARs at the central repository. We can only store metadata about those JARs and it is the metadata that contains location and retrieval information.

Once you have downloaded a particular Sun JAR to your system you can install the JAR in your local repository. Please refer to our Guide to installing 3rd party JARs for instructions on how to accomplish this.

Note: Java.net provides a Maven 2 repository. You could specify it directly in your POM or in your settings.xml between the tags <repositories>:

...
      <repositories>
        <repository>
          <id>maven2-repository.dev.java.net</id>
          <name>Java.net Repository for Maven</name>
          <url>http://download.java.net/maven/2/</url>
          <layout>default</layout>
        </repository>
      </repositories>
...