Resin 4 Maven Dependencies

From Resin 4.0 Wiki

(Difference between revisions)
Jump to: navigation, search
(Resin 4 Maven Dependencies)
 
(3 intermediate revisions by one user not shown)
Line 11: Line 11:
 
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml
 
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml
  
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API.  It also prevents you from upgrading individual APIs.  This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.
+
Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API.  It also prevents you from upgrading individual APIs.  This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.
  
 
     <dependencies>
 
     <dependencies>
Line 30: Line 30:
 
     ....
 
     ....
  
3. Add all the individual WebProfile API dependencies to maven.  This is the most flexible but more verbose choice.  Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available.  In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.
+
3. Add all the individual WebProfile API dependencies to your pom.xml.  This is the most flexible but more verbose choice.  Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available.  In this case you should include the API that matches the included version, or download the latest implementation and update the jar in Resin's lib directory.
  
 
Since Resin provides all these during runtime, the scope should always be set to provided.  This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.
 
Since Resin provides all these during runtime, the scope should always be set to provided.  This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.
Line 93: Line 93:
 
       </dependency>
 
       </dependency>
 
       <dependency>
 
       <dependency>
         <groupId>javax.ejb</groupId>
+
         <groupId>org.glassfish</groupId>
         <artifactId>ejb-api</artifactId>
+
         <artifactId>javax.ejb</artifactId>
         <version>3.0</version>
+
         <version>3.1</version>
 
         <scope>provided</scope>
 
         <scope>provided</scope>
 
       </dependency>
 
       </dependency>

Latest revision as of 15:49, 7 March 2014

Construction-48.png

Resin 4 Maven Dependencies

All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.

For Maven development there are a few options.

1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.

2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml

Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.

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

  <repositories>
   <repository>
     <id>java.net.m2</id>
     <name>java.net m2 repo</name>
     <url>http://download.java.net/maven/2</url>
   </repository>
   ....

3. Add all the individual WebProfile API dependencies to your pom.xml. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the included version, or download the latest implementation and update the jar in Resin's lib directory.

Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.

    <dependencies>
 
      <!-- API's -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>javax.servlet.jsp-api</artifactId>
        <version>2.2.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.el</groupId>
        <artifactId>javax.el-api</artifactId>
        <version>2.2.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.servlet.jsp.jstl</groupId>
        <artifactId>jstl-api</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>transaction-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>jsr250-api</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.1.0.Final</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.cache</groupId>
        <artifactId>cache-api</artifactId>
        <version>0.8</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.ejb</artifactId>
        <version>3.1</version>
        <scope>provided</scope>
      </dependency>
 
      <!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) -->
      <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.5.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.3.1.Final</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.2.2</version>
        <scope>provided</scope>
      </dependency>
 
      ...
Personal tools
TOOLBOX
LANGUAGES