Maven dependency for Servlet 3.0 API? Maven dependency for Servlet 3.0 API? java java

Maven dependency for Servlet 3.0 API?


This seems to be added recently:

https://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.0.1/

<dependency>        <groupId>javax.servlet</groupId>        <artifactId>javax.servlet-api</artifactId>        <version>3.0.1</version>        <scope>provided</scope></dependency>


I'd prefer to only add the Servlet API as dependency,

To be honest, I'm not sure to understand why but never mind...

Brabster separate dependencies have been replaced by Java EE 6 Profiles. Is there a source that confirms this assumption?

The maven repository from Java.net indeed offers the following artifact for the WebProfile:

<repositories>  <repository>    <id>java.net2</id>    <name>Repository hosting the jee6 artifacts</name>    <url>http://download.java.net/maven/2</url>  </repository></repositories>        <dependencies>  <dependency>    <groupId>javax</groupId>    <artifactId>javaee-web-api</artifactId>    <version>6.0</version>    <scope>provided</scope>  </dependency></dependencies>

This jar includes Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP 2.2, EL 1.2, JSTL 1.2, JSF 2.0, JTA 1.1, JSR-45, JSR-250.

But to my knowledge, nothing allows to say that these APIs won't be distributed separately (in java.net repository or somewhere else). For example (ok, it may a particular case), the JSF 2.0 API is available separately (in the java.net repository):

<dependency>   <groupId>com.sun.faces</groupId>   <artifactId>jsf-api</artifactId>   <version>2.0.0-b10</version>   <scope>provided</scope></dependency>

And actually, you could get javax.servlet-3.0.jar from there and install it in your own repository.


Or you can use the Central Maven Repository with the Servlet 3.0 API which is also provided for the Tomcat Server 7.0.X

    <dependency>        <groupId>org.apache.tomcat</groupId>        <artifactId>tomcat-servlet-api</artifactId>        <version>7.0.21</version>        <scope>provided</scope>    </dependency>

from here: http://repo2.maven.org/maven2/org/apache/tomcat/tomcat-servlet-api/7.0.21/