Deploy Maven War Project in to Tomcat automatically - Java @ Desk

Tuesday, April 26, 2016

Deploy Maven War Project in to Tomcat automatically



Deploy Maven War Project in to Tomcat automatically



Maven allows auto deployment of a war file into tomcat. In order to do so, maven-war-plugin is utilized. The plugin helps copying the war file into tomcat webapp's folder defined in the configuration.



<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>
 <configuration>
  <outputDirectory>C:\Kumar\Software\apache-tomcat-8.0.28-windows-x64\apache-tomcat-8.0.28-windows-x64\apache-tomcat-8.0.28\webapps</outputDirectory>
  <warName>prs-war</warName>
 </configuration>
</plugin>


<outputDirectory>
- Path of the tomcat web app folder.

This helps in automatic deploying the war into tomcat and no need to restart the server after each build.







No comments:

Post a Comment