Created a simple Webapp using maven:
mvn archetype:generate -DgroupId=com.kids -DartifactId=kidsMaven -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
My POM file is as follows:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kids</groupId>
<artifactId>kidsMaven</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>kidsMaven Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>kidsMaven</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
I wanted to run my this bootstrap webapp on tomcat server using maven plugin. When I am executing
mvn tomcat:deploy
I am getting following error:
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project kidsMaven: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
I have not installed tomcat externally; instead wants maven to even control my tomcat installation too.
tomcat:deploy
pushes webapp to an existing tomcat deployment. You probably want tomcat:run
.