Could anyone provide simple configuration of Jersey and Embedded Tomcat in: 1) pom.xml 2) main method
I was trying to find it in google search, but they propose to use grizzly, glassfish and etc.
Thanks a lot.
Could anyone provide simple configuration of Jersey and Embedded Tomcat in: 1) pom.xml 2) main method
I was trying to find it in google search, but they propose to use grizzly, glassfish and etc.
Thanks a lot.
I would go for webapp-runner to run the web app. It deploys the maven generated war from /target into a built in tomcat container. This is how java applications gets deployed on Heroku.
pom plugin configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>7.0.34.1</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
Dependency:
<dependency>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>7.0.34.1</version>
<scope>provided</scope>
</dependency>
to run the application after mvn clean package
java -jar target\dependency\webapp-runner.jar target\myapp.war