Eclipse,myeclipse development environment, MAVEN one-click Deployment to TOMCAT7 (graphics)

Source: Internet
Author: User
Tags stack trace java web

Some people want to write Java Web Projects in Eclipse, and Maven is also a way to implement a Java Web project that can be packaged into a war and published to Tomcat.

Add the following code to the build of the Pom.xml file, modify the account and password accordingly, and the name of the publication

    <Build>        <Finalname>Daka_server</Finalname><!--original code--
<plugin> <groupId>Org.codehaus.mojo</groupId> <Artifactid>Tomcat-maven-plugin</Artifactid> <version>1.1</version> <Configuration> <URL>Http://localhost:8080/manager/text</URL> <Server>Healthpad</Server> <username>Dakaclub</username> <Password>Dakaclub</Password> </Configuration> </plugin> </Plugins> </Build>

Modify the Apache-tomcat-7.0.52-9080\conf\tomcat-users.xml file

<?XML version= ' 1.0 ' encoding= ' utf-8 '?><tomcat-users>    <rolerolename= "Admin-gui"/>    <rolerolename= "Admin-script"/>    <rolerolename= "Manager-gui"/>    <rolerolename= "Manager-script"/>    <rolerolename= "MANAGER-JMX"/>    <rolerolename= "Manager-status"/>    <Userusername= "Dakaclub"Password= "Dakaclub"Roles= "Manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/> <rolerolename= "MANAGER-JMX"/> <rolerolename= "Manager-status"/></tomcat-users>

Right-click the project

Create a new Maven run task

Click Browse Workspace to select the project to run, fill in the Tomcat:deploy or Tomcat:redeploy in goals,

The network said to fill MVN tomcat:deploy, but in the Eclipse environment do not fill in mvn,

If you fill out the MVN tomcat:deploy will be an error:

[ERROR] Unknown lifecycle Phase "MVN". Must specify a valid lifecycle phase or a goal in the format<Plugin-prefix>:<goal>Or<Plugin-group-id>:<Plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle Phases Are:validate, Initialize, generate-sources, process-sources, Generate-resources, Process-resources, compile, process-classes, generate-test-sources, Process-test-sources, Generate-test-resources, Process-test-resources, Test-compile, process-test-classes, test, Prepare-package, package, Pre-integration-test, Integration-test, Post-integration-test, verify, install, deploy, Pre-site, site, Post-site, Site-deploy, Pre-clean, Clean, Post-clean. "Help 1][error" [ERROR] to see the full stack trace of the errors, re-run Maven with THE-E switch. [ERROR] Re-run Maven using The-x switch to enable full debug logging. [ERROR] [ERROR] For more information on the errors and possible solutions, please read the following articles:[error] [Help 1] http://c Wiki.apache.org/confluence/display/maven/lifecyclephasenotfoundexception

The

is done.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.