It sounds like Eclipse (Kepler) does not have a proper plugin for Tomcat 8. I want to deploy my .war into Tomcat 8 and run it by Maven pom.xml file. Can anyone provide me step-by-step guidance or any resources, please?
My POM 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Test-App</groupId>
<artifactId>test-rest</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>test-rest Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- Tomcat plugin -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/${project.build.finalName}</path>
<update>true</update>
<url>http:// localhost:8080/manager/text</url>
<username>tomcat</username>
<password>tomcatuser</password>
</configuration>
</plugin>
</plugins>
<finalName>test-rest</finalName>
</build>
</project>
Yes, this is really possible and is very easy to handle through the use of powerful tool “Maven“. Maven provides a graceful plugin called tomcat7-maven-plugin through which the Tomcat Web Server can be embedded seamlessly into a Maven project.
The Apache Tomcat Maven Plugin provides goals to manipulate WAR projects within the Apache Tomcat servlet container. You can run your War Apache Maven project through Apache Maven without deploying your WAR file to an Apache Tomcat instance.
Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model (POM).
Can you use the cargo pluygin instead, this works for me, deploying to tomcat8 :
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.8</version>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<home>${env.CATALINA_HOME}</home>
</container>
<configuration>
<type>existing</type>
<home>${env.CATALINA_HOME}</home>
</configuration>
<deployables>
<deployable>
<groupId>com.yourcompany</groupId>
<artifactId>ROOT</artifactId>
<type>war</type>
<properties>
<context>${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
<deployer>
<type>installed</type>
</deployer>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With