Unable to Deploy war using maven 3.x - maven-2

I am trying to deploy my web-application to tomcat using maven 3.x here is the snap shot of the pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo</groupId>
<artifactId>demoapp</artifactId>
<version>2.2.3</version>
<packaging>war</packaging>
<name>Blank Webapp</name>
<properties>
<struts2.version>2.2.3</struts2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<warFile>${project.build.directory}/${project.build.finalName}.war</warFile>
<url>http://localhost:8080/manager/html</url>
<server>localhost</server>
<path>/WebApp</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
i tried the following goal in maven mvn deploy but i got the following build fail with following error
Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
after doing some googling i added the following entry to my pom.xml
<distributionManagement>
<repository>
<id>myRepoId</id>
<name>myCompanyReporsitory</name>
<!-- <url>scp://nothing/</url>
<url>${user.home}/m2/repository</url> -->
</repository>
</distributionManagement>
but i am not sure what should be the URL since using ${user.home}/m2/repository gave another error with build failure
Failed to deploy artifacts/metadata: No connector available to access repository myRepoId (C:\Users\admin/m2/repository) of type default using the available factories WagonRepositoryConnectorFactory -> [Help 1]
How to solve the problem?

The mvn deploy tries to send the result of the package goal to the url of repository described in your POM.
I aims not at deploying a Web application on its server but to share the library produced with other.
If what you need is to deploy you webapp, then the tomcat plugin is a solution.
BTW: The connector issue when trying to deploy is due to the fact that to enable SCP you need to add the wagon-scp connector.

Related

After the Jenkins build is successful, it is showing 'No tests to run.' for cucumber automation

I have configured my cucumber web automation with Jenkins, though the build is successful it's showing below error
[[1;34mINFO[m] [1m--- [0;32mmaven-compiler-plugin:3.1:testCompile[m [1m(default-testCompile)[m # [36mBDDSeleniumFramework[0;1m ---[m
[[1;34mINFO[m] No sources to compile
[[1;34mINFO[m]
[[1;34mINFO[m] [1m--- [0;32mmaven-surefire-plugin:2.12.4:test[m [1m(default-test)[m # [36mBDDSeleniumFramework[0;1m ---[m
[[1;34mINFO[m] No tests to run.
[[1;34mINFO[m]
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>abc.com</groupId>
<artifactId>BDDSeleniumFramework</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
<name>BDDSeleniumFramework</name>
<description>BDD-Selenium-Java-Automation-Framework</description>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
please let me know if you have any solution. Thanks in advance
Basically, if your test framework is TestNg then you need to add the surefire plugin to your pom.
Please have a look at this and update your POM accordingly.

Status HTTP 404: with a Spring Boot api web service developed with Intellij via remote Tomcat server

I created a spring boot initializer type web service under Intellij.
I can access my api in localhost via the ide server.
Example of api: http://localhost:8088/indicatorMissing/api/listCircuits
But when I create a war package that I deploy in a remote tomcat server, I have the window:
HTTP Status 404 – Not Found
Status Report Type
message /flagMissing/api/listCircuits
description The requested resource is not available.
Apache Tomcat/8.5.14 (Debian).
I tried the addresses:
:8080/missingflag/api/listCircuits
Where
:8080//MissingIndicator/api/listCircuits
Voici mon POM.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sbvb</groupId>
<artifactId>indicateur_manquant</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>indicateur_manquant</name>
<description>indicateur_manquant</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Can anybody help me ?
Thank you

Robot Framework: Getting build error for missing Jar

I have started learning Robot Framework (with Java & selenium lib) and was trying to write a simple test case in it. Could you please help me with it.
I have copied tools jar in the mentioned lib and also in the dependancy
But still did not work
Following is the error
Failed to execute goal org.robotframework:robotframework-maven-plugin:1.4.6:run (default-cli) on project JavaRobot: Execution default-cli of goal org.robotframework:robotframework-maven-plugin:1.4.6:run failed: Plugin org.robotframework:robotframework-maven-plugin:1.4.6 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:6 at specified path C:\Program Files\Java\jre1.8.0_101/../lib/tools.jar -> [Help 1]
Here is my POM.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.Robot</groupId>
<artifactId>JavaRobot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>JavaRobot</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>robotframework</artifactId>
<version>2.8.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>C:\Program Files\Java\jdk1.8.0_101\lib\tools.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.8</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.6</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Try to add the exclusion , I think it will fix your problem.
Example:
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.7</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
</exclusions>

Maven build not running

i have created a maven build of my project.The build was succesfull.But when i deploy it on server (apache tomcat 6) it gives various errors regarding jar files.But those jar files are available on the class path.But when i keep those jar files in the lib directory of server then that error gets resolved.So,anyone having any idea regarding this..I have done anything wrong in building using maven.
My pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
Test1
Test1
0.0.1-SNAPSHOT
war
Test1
http://maven.apache.org
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-core</artifactId>
<version>1.3.10</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.8</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.10</version>
</dependency>
<dependency>
<groupId>org.ow2.orchestra.eclipse.birt</groupId>
<artifactId>org.ow2.orchestra.eclipse.birt.core</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.ow2.orchestra.eclipse.birt</groupId>
<artifactId>org.ow2.orchestra.eclipse.birt.report.engine</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>openforecast</groupId>
<artifactId>openforecast</artifactId>
<version>1.0.16</version>
<scope>system</scope>
<systemPath>D:/testing/WebContent/WEB-INF/lib/OpenForecast-0.5.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>net.sf.jsci</groupId>
<artifactId>jsci</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-taglib</artifactId>
<version>1.3.10</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>struts</groupId>
<artifactId>struts-bean</artifactId>
<version>1.2.7</version>
<type>tld</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<properties>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source>
</properties>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<packagingExcludes>D:/Test1/src/main/webapp/WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
You don't deploy a jar on a Tomcat : you deploy a war file.
The war contains a WEB-INF/lib folder which contains your libraries.
The lib folder at the Tomcat root is used only for libraries shared between all deployed applications. For example, the database driver.
Check that your Maven dependencies are not in scope provided.
They should be included in your WEB-INF/lib folder.
First things like your dependency to the servlet api:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
Must have a scope "provided" like this which means they will be needed for compiling but in the runtime it will be provided by Tomcat in this case.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
The following:
openforecast
openforecast
1.0.16
system
D:/testing/WebContent/WEB-INF/lib/OpenForecast-0.5.0.jar
indicates you are not using a Repository which is a real must. Never use system scoped dependencies in your build, cause they will make you build environment specific.
Start using a repository manager (Nexus, Artifactory or Archive) and install the openforecast there.
And it's bad practice to define repositories in your pom and in particular Maven Central like you did.
If you have defined the following in your pom as you have:
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
The configuration of the maven-compiler-plugin is not needed like this, cause the encoding parameter uses as default the above property.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<properties>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source>
</properties>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
you can use the following:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
But you must define the version of your used plugins:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
The best to do is using a pluginManagement section.
One other thing which comes to my mind is that your are using an old maven-war-plugin and you are using absolute paths in your configuration which you should avoid under any circumstances.
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<packagingExcludes>D:/Test1/src/main/webapp/WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
The up-to-date version is 2.2 as the web-site says. If you need to exclude things like this you should do it in the following way:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<packagingExcludes>${basedir}/src/main/webapp/WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
But in this case i don't understand why you like to exclude the web.xml, cause it's an essential part of a war file. May be you can elaborate that a little bit more.

JSF 1.1 to 1.2 migration

I'm currently using JSF 1.1 on Apache Tomcat 6.0.13, with maven 2.
I'm planing to migrate from JSF 1.1 to 1.2. Could someone point me at:
- what JSF implementation is best to use
- is this implementation available at maven central repository
- what part of code will I need to adjust (I'm using custom tags in my project, but besides that it's all plain JSF)
etc.
Any info would be helpful... Thanx!
[edit 1]:
Hm, it haven't worked for me. Dependencies cannot be downloaded from the repository you've specified. Maybe it's because this is link for maven 1 repository. I'm using following pom settings instead:
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/jsf-api.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/jsf-impl.jar</systemPath>
</dependency>
I hope this approach is the correct one. If someone has a more maven-friendly solution, please advise. Thanx!
[edit 2]:
After I've changed my JSF jar from 1.1. to 1.2, following error occurred during application startup:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory:
javax.faces.context.FacesContextFactory
To fix this error, additional listener need to be added in web.xml:
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
Have a look at the following release notes that has a migration guide from 1.1 to 1.2
http://java.sun.com/javaee/javaserverfaces/docs/ReleaseNotes.html
The maven2 artifacts for JSF 1.2 have found their way in the standard maven2 repository located at http://http://repo1.maven.org/maven2
JSF Implementation
http://repo2.maven.org/maven2/javax/faces/jsf-impl/1.2-b19/
JSF API
http://repo1.maven.org/maven2/javax/faces/jsf-api/1.2-b19/
As such, you shouldn't require any special repository setup in your pom.xml or settings.xml
The dependencies can be defined like this in the pom (1.2-b19 is the latest version at the time of writing) :
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2-b19</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2-b19</version>
</dependency>
Included below is a full pom.xml that should contain the basic dependencies for starting a JSF 1.2 project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ecs.sample.jsf</groupId>
<artifactId>SampleJsfPom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2-b19</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2-b19</version>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.11</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>