Tomcat 8 Maven Plugin for Java 8 -
is tomcat7-maven-plugin
working tomcat 8 server , java 8? can't find tomcat8-maven-plugin
.
yes can,
in pom.xml, add tomcat plugin. (you can use both tomcat 7 , 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 on (both ubuntu , windows 8/10):
* jdk 7 & tomcat 7
* jdk 7 & tomcat 8
* jdk 8 & tomcat 7
* jdk 8 & tomcat 8
* jdk 8 & tomcat 9
tested on both jdk 7/8 & tomcat 7/8. (works tomcat 8.5 , 9)
note:
tomcat manager should running or setup, before can use maven.
good luck!
Comments
Post a Comment