


If we build, deploy, and load this application as is, it'll print Hello World! in the browser. This will create a complete Java web application in the cargo-deploy directory. Mvn archetype:generate -DgroupId=com.baeldung -DartifactId=cargo-deploy

Finally, the path element defines the context path of our deployment. The server element is the name of the server instance that Maven recognizes. The configuration url is the url to which we're sending our deployment, and Tomcat will know what to do with it. Note that we're using the Tomcat 7 plugin because it works for both versions 7 and 8 without any special changes. Let's head over to the pom.xml and add this plugin: This will create a complete web application in the directory tomcat-war-deployment, which will print hello world! if we deploy it now and access it via the browser.īut before we do that, we need to make one change to enable Maven deployment. DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false We'll run this command on the console to create a new Java web application: mvn archetype:generate -DgroupId=com.baeldung -DartifactId=tomcat-war-deployment Let's navigate to where we would like to create the application. Now we'll need to create a basic web application from Maven to test the deployment. Once we have found it, we'll add Tomcat: There are two locations where the settings.xml file may be found:
