Showing posts with label Tomcat. Show all posts
Showing posts with label Tomcat. Show all posts

Thursday, April 15, 2010

Deploying war to Tomcat using Maven

Step1: Add following in tag:


Step2: Add the username and password for the manager account in $MAVEN_HOME/conf/settings.xml file.
value in tag in step1 should be same as id in in step2


Step3: Maven command to build & deploy
        mvn clean install tomcat:deploy


to undeploy use: 
     mvn tomcat:undeploy


This does:

  • Deletes the service-war/target output folder if it already exists (same as mvn clean alone)
  • Recreates the folder and generates and compiles the Java classes into it (mvn package)
  • Creates a WAR file for the web service provider and JAR file for the JAX-WS artifacts (mvn package)
  • Installs the JAR and WAR into your local Maven repository (mvn install)
  • Undeploys the previous WAR file (tomcat:undeploy of the Maven Tomcat plugin) from Tomcat
  • Deploys the new WAR file onto Tomcat. (mvn tomcat:deploy)

Wednesday, March 31, 2010

Creating DataSource in Tomcat

Unlike Weblogic AppServer, the tomcat don't provide way to add the datasource via the admin console.
For managing the datasource, we need to edit the settings.xml; follow the link:
Datasource in Tomcat
[This done by editing context.xml in the apache~/conf]