S2sh Maven Pom. xml

Source: Internet
Author: User
Tags maven compiler plugin
Environment: Tomcat: 7.0.14maven: 3.0.3
<Project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion> 4.0.0 </modelversion> <groupid> CN. heardy. s2sh </groupid> <artifactid> s2sh </artifactid> <packaging> war </packaging> <version> 1.0-Snapshot </version> <Name> s2sh Maven webapp </Name> <URL> HTTP: // Maven. Apache.org </URL> <build> <finalname> s2sh </finalname> <plugins> <! -- Maven Tomcat plugin --> <plugin> <groupid> Org. codehaus. mojo </groupid> <artifactid> tomcat-Maven-plugin </artifactid> <configuration> <URL> http: // localhost: 9080/manager/html </URL> <Server> tomcatserver </Server> <username> admin </username> <password> admin </password> <path>/s2sh </ path> </configuration> </plugin> <! -- Maven compiler plugin --> <plugin> <artifactid> Maven-compiler-plugin </artifactid> <configuration> <source> 1.6 </source> <target> 1.6 </Target> </configuration> </plugin> <! -- Copy *. HBM. XML to todir --> <plugin> <groupid> Org. apache. maven. plugins </groupid> <artifactid> Maven-antrun-plugin </artifactid> <version> 1.2 </version> <executions> <execution> <ID> prepare-dependencies-repackage- copy </ID> <phase> Generate-resources </phase> <goals> <goal> RUN </goal> </goals> <configuration> <tasks> <copy todir = "Target/classes/COM/heardy/Bean" Overwrite = "true"> <fileset dir = "src/main/Java/COM/heardy/Bean"> <include name =" **/*. HBM. XML "/> </fileset> </copy> </tasks> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupid> Org. apache. struts </groupid> <artifactid> struts2-core </artifactid> <version> 2.2.3.1 </version> </dependency> <groupid> Org. apache. struts </groupid> <artifactid> struts2-spring-plugin </artifactid> <version> 2.2.3.1 </version> <type> jar </type> <scope> compile </scope> <exclusions> <exclusion> <artifactid> spring-beans </artifactid> <groupid> Org. springframework </groupid> </exclusion> <artifactid> spring-core </artifactid> <groupid> Org. springframework </groupid> </exclusion> <artifactid> spring-context </artifactid> <groupid> Org. springframework </groupid> </exclusion> <artifactid> spring-Web </artifactid> <groupid> Org. springframework </groupid> </exclusion> </exclusions> </dependency> <groupid> Org. springframework </groupid> <artifactid> spring </artifactid> <version> 2.5.6.sec02 </version> <type> jar </type> <scope> compile </scope> </dependency> <dependency> <groupid> javax. transaction </groupid> <artifactid> transaction-API </artifactid> <version> 1.1 </version> </dependency> <groupid> mysql </groupid> <artifactid> mysql-connector-Java </artifactid> <version> 5.1.18 </version> <scope> provided </scope> </dependency> <groupid> commons-DBCP </groupid> <artifactid> commons-DBCP </artifactid> <version> 1.4 </version> </dependency> <groupid> Org. hibernate </groupid> <artifactid> hibernate-core </artifactid> <version> 3.6.8.final </version> <exclusions> <exclusion> <artifactid> JTA </artifactid> <groupid> javax. transaction </groupid> </exclusion> </exclusions> </dependency> </dependencies> </Project>

If the error is returned for Row 3 <execution>: plugin execution not covered by lifecycle configuration: Org. apache. maven. plugins: Maven-antrun-plugin: 1.2: Run (Execution: Prepare-dependencies-repackage-copy, phase: generate-resources)

This error is okay and can run properly.

$ {Maven_home}/CONF/settings. xml

<server>    <id>TomcatServer</id>    <username>admin</username>    <password>admin</password></server>

Tomcat configuration administrator: conf \ tomcat-users.xml

<tomcat-users>    <role rolename="manager"/>    <user username="admin" password="admin" roles="manager"/>  </tomcat-users>

Note:

<user username="admin" password="admin" roles="manager"/>  -------><username>admin</username><password>admin</password>

Related commands
Run package deployment:

mvn tomcat:deploy

Undeploy:

mvn tomcat:undeploy

Start a web application:

mvn tomcat:start

Stop a web application:

mvn tomcat:stop

Redeployment:

mvn tomcat:redeploy

Deployment expansion file:

mvn war:exploded tomcat:exploded

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.