Just in case, you are using a separate local Tomcat server. If you use the built-in tomcat, this is not applicable.
In your pom.xml add the tomcat plugin. (You can use this for Tomcat 7 and 8):
pom.xml
<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
Tested on both Jdk 7/8 and Tomcat 7/8. (Works with Tomcat 8.5 Also, Tomcat 9 will be testing soon)
Note:
Tomcat Manager must be running or configured correctly before you can use it with maven.
Borgy Manotoy Sep 01 '17 at 15:15 2017-09-01 15:15
source share