tomcat:deploy: “Cannot invoke Tomcat manager: Connection refused”

When using the tomcat 7 plugin, do the following: 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> <path>/mycontext</path> <username>admin</username> <password>admin</password> </configuration> </plugin> settings.xml <server> <id>tomcatserver</id> <username>admin</username> <password>admin</password> </server> tomcat-users.xml <user username=”admin” password=”admin” roles=”manager-script”/> run mvn tomcat7:deploy

How to run Tomcat 7 using Maven 2 Tomcat plugin?

This works for me: http://tomcat.apache.org/maven-plugin-2.1/ With this plugin config: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <path>/</path> </configuration> </plugin> And running with mvn clean install tomcat7:run (Please note that tomcat7:run, not tomcat:run.) Plugin documentation is here: http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/plugin-info.html For example, the default value of additionalConfigFilesDir is ${basedir}/src/main/tomcatconf, so if you put your configs into this directory it will … Read more

Tomcat 8 Maven Plugin for Java 8

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 … Read more