Friday 15 May 2015

java - Maven web app not deploying in local Tomcat -


I had a web app project on eclipse Luna for a time (built as dynamic web project); To test, I used the "run on server" option, and it was running properly on my tokkat 7 server.

But now, I have organized this project and can not run any way, as easily as I used, there is no option to "run on server" as well, if I Click on the project folder or run as "Maven install / build ..." if I click on the pom.xml file then just "run as Java application / applet".

Can any way go back to running my favorite webpad on my local server?

Thank you!

Add it to your pom.xlm :

  & lt; Construction & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.tomcat.maven & lt; / Group & gt; & Lt; ArtifactId & gt; Tomcat7-maven-plugin & lt; / ArtifactId> & Lt; Version & gt; 2.2 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; URL & gt; Http: // localhost: 8080 / manager / text & lt; / URL & gt; & Lt; Server & gt; $ {Tomcat.server.name} & lt; / Server & gt; & Lt; Webapps & gt; & Lt; Webapp & gt; & Lt; Group & gt; Com.group.id & lt; / Group & gt; & Lt; ArtifactId & gt; Artifact & lt; / ArtifactId> & Lt; Version & gt; 1 & lt; / Edition & gt; & Lt; Type & gt; War & lt; / Type & gt; & Lt; AsWebapp & gt; True & lt; / AsWebapp & gt; & Lt; Path & gt; / Path & lt; / Path & gt; & Lt; / Webapp & gt; & Lt; / Webapps & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt;  

After that, you have to set some things in Tomato Config. I set the following things to tomcat / conf / tomcat-users.xml :

  & lt; Tomcat-users & gt; ... & lt; Role rolename = "manager-script" /> & Lt; Role rolename = "manager-gui" /> & Lt; User user name = "admin" password = "admin" roles = "manager-script, manager-gy" /> & Lt; / Badge users & gt; Set the value of the variable to   

and $ {tomcat.server.name} MAYEN settings.xml file ( ~ /.m2/settings.xml ), and some other stuff:

  & lt; Settings & gt; ... & lt; Profile & gt; & Lt; Profile & gt; & Lt; ID & gt; Profile-1 & lt; / Id & gt; & Lt; Activation & gt; & Lt; ActiveByDefault & gt; True & lt; / ActiveByDefault & gt; & Lt; / Activation & gt; & Lt; Properties & gt; & Lt; Tomcat.server.name & gt; TomcatServer & LT; /tomcat.server.name> & Lt; / Properties & gt; ... & lt; / Profile & gt; & Lt; / Profile & gt; & Lt; Server & gt; & Lt; Server & gt; & Lt; ID & gt; TomcatServer & lt; / Id & gt; & Lt; Username & gt; Admin & lt; / Username & gt; & Lt; Password & gt; Admin & lt; / Password & gt; & Lt; / Server & gt; & Lt; / Server & gt; & Lt; / Settings & gt; After this, you will be able to run, install  mvn clean tomcat: deploy  or  install mvn clean tomcat: redeploy  , And he will run 

For more configuration information, see!


No comments:

Post a Comment