Pre-requisites 1. Maven Server [Get help here] 2. Tomcat Server [Get help here]
Procedure
-
download archetype maven-archetype-webapp
mvn archetype:generate -DgroupId=com.valaxy.webapp -DartifactId=helloworld-project -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
-
Update pom.xml code to add maven plugin to copy artifacts onto tomcat this should be under
<plugins> <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>/helloworld-webapp</path> </configuration> </plugin> </plugins>
-
create settings.xml for credentials
<?xml version="1.0" encoding="UTF-8"?> <settings ...> <servers> <server> <id>TomcatServer</id> <username>admin</username> <password>password</password> </server> </servers> </settings>
1. Build and the project on tomcat
```sh
mvn tomcat7:deploy