I am using this code to deploy a web application. I want to add webserver functionality. For this purpose I have modified pom.xml by adding this code fragment:
<plugins>
...
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.5.v20130815</version>
</plugin>
...
</plugins>
Also I added in the root of the project the folder webapp with this structure:
+ webapp
+META-INF
+WEB-INF
+lib
-web.xml
-index.html
-index2.html
In web.xml I have this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>test-jetty</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
I can compile the project by two ways:
- By Maven: SOAP and REST work, but webserver not. Steps I do:
- (in project root) mvn package
- cd target
- java -jar server.jar
- By Jetty: Web server works but SOAP and REST not. Steps I do:
- (in project root) mvn jetty:run OR
- (in Eclipse) Run > Run as > Run with Jetty
How can I integrate both functionalities?