Tomcat 8 Maven Plugin for Java 8

Does tomcat7-maven-plugin with tomcat 8 and java 8 server? I can not find tomcat8-maven-plugin .

+59
java-8 tomcat tomcat8 maven-tomcat-plugin
Nov 12 '14 at 9:49
source share
4 answers

Yes, you can,

In your pom.xml add the tomcat plugin. (You can use this for Tomcat 7 and 8):

pom.xml

 <!-- Tomcat plugin --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>http:// localhost:8080/manager/text</url> <server>TomcatServer</server> *(From maven > settings.xml)* <username>*yourtomcatusername*</username> <password>*yourtomcatpassword*</password> </configuration> </plugin> 

users.xml-cat

 <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="admin" password="password" roles="manager-gui,manager-script" /> </tomcat-users> 

settings.xml (maven> conf)

 <servers> <server> <id>TomcatServer</id> <username>admin</username> <password>password</password> </server> </servers> 

* deployment / redeployment

mvn tomcat7: deploy OR mvn tomcat7: redeploy

Tried this (Both Ubuntu and Windows 8/10):
* Jdk 7 and Tomcat 7
* Jdk 7 and Tomcat 8
* Jdk 8 and Tomcat 7
* Jdk 8 and Tomcat 8
* Jdk 8 and Tomcat 9

Tested on both Jdk 7/8 and Tomcat 7/8. (Works with Tomcat 8.5 and 9)

Note:
Tomcat Manager must be running or configured correctly before you can use it with maven.

Good luck

+60
Jan 28 '16 at 10:33
source share

Tomcat 7.0.47 Launch Plugin:

mvn org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run

  ... INFO: Starting Servlet Engine: Apache Tomcat/7.0.47 

This is a sample to run the plugin with Tomcat 8 and Java 8: Cargo embedded tomcat: custom context.xml

+4
Jul 6 '16 at 13:39
source share

Almost 2 years later ....
This readme github project has some clarity of the maven plugin configuration and it seems, in accordance with this apache github project , the plugin itself will be implemented soon enough.

0
Sep 07 '16 at 13:17
source share

Changing the name of groupId and Mojo Since version 2.0-beta-1 tomcat mojos has been renamed tomcat6 and tomcat7 for the same purpose.

You must configure pom to use this new groupId:

 <pluginManagement> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat6-maven-plugin</artifactId> <version>2.3-SNAPSHOT</version> </plugin> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.3-SNAPSHOT</version> </plugin> </plugins> </pluginManagement> 

Or add groupId to your settings.xml

.... org.apache.tomcat.maven ....

0
Jan 24 '18 at 3:45
source share



All Articles