Is the tomcat7-maven-plugin
working with a tomcat 8 server and java 8? I can't find any tomcat8-maven-plugin
.
The Tomcat Maven Plugin provides goals to manipulate WAR projects within the Tomcat 8. x servlet container.
Tomcat 8.0 is designed to run on Java 7. For reference, the following specifications have been supported: Tomcat 6: Servlet 2.5, JSP 2.1, and EL 2.1.
The Tomcat7 Maven Plugin provides goals to manipulate WAR projects within the Tomcat servlet container version 7.x.
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.
Yes you can,
In your pom.xml
, add the tomcat plugin. (You can use this for both 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>
tomcat-users.xml
<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>
*** deploy/re-deploy**
mvn tomcat7:deploy
OR mvn tomcat7:redeploy
Tried this on (Both Ubuntu and Windows 8/10):
Tested on Both Jdk 7/8 & Tomcat 7/8. (Works with Tomcat 8.5 and 9)
Note:
Tomcat manager should be running or properly setup, before you can use it with maven.
Good Luck!
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