I created a simple webapp via maven 3.1.1. I just want to develop a simple servlet. After doing a clean install I've expected the class-files of the servlet in the target/WEB-INF/classes-Directory. But there were just the copied source files.
What did I do wrong?
I haven't found any conclusion yet :(
---------- System information
- maven version: Apache Maven 3.1.1
- java version: 1.7.0_40 OS
- Windows 8.1
---------- 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.mypage</groupId>
<artifactId>ThirdServlet</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ThirdServlet Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>servlet-api</artifactId>
<version>6.0.37</version>
</dependency>
</dependencies>
<build>
<finalName>ThirdServlet</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
---------- File-Structure
- src/main/resources/de/mypage/servlets/MyServlet.java
- src/main/resources/webapp/index.jsp
- src/main/resources/webapp/WEB-INF/web.xml
---------- My Servlet
some imports
public class MyServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* Default constructor.
*/
public MyServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<body>");
pw.println("<h2>");
pw.println("If you can read this the servlet is running...");
pw.println("</h2>");
pw.println("</body>");
pw.println("</html>");
pw.close();
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}