MyEclipse + MAVEN Development SPRINGMVC detailed configuration process for Web engineering

Source: Internet
Author: User

Make sure the MAVEN environment is complete before you operate.

One, create a MAVEN project

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/96/wKiom1RTrpXwEdCXAAGe9yoKnV8072.jpg "style=" float: none; "title=" M1.png "alt=" Wkiom1rtrpxwedcxaage9yoknv8072.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/95/wKioL1RTrvDBgat4AAGvMkJVG3s341.jpg "style=" float: none; "title=" M2.png "alt=" Wkiol1rtrvdbgat4aagvmkjvg3s341.jpg "/>


Second, the directory structure of the complete project

The MAVEN engineering catalog generated in the 1th step is incomplete and requires manually adding the required directories.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/96/wKiom1RTr7Ojb_BmAAE9ErekuzY488.jpg "title=" M3.png "alt=" wkiom1rtr7ojb_bmaae9erekuzy488.jpg "/>

Third, add MyEclipse Web Project features

So far, we've just imported a maven webapp into the MyEclipse, but in MyEclipse it's just a Java generic Maven project, and we're going to add the MyEclipse Web Project feature to it.

Select Project-->myeclipse-->project capabilities-->add Web Project Capabilites, set the parameters in the pop-up window as follows, then select Yes in the next pop-up window. So our project is Web engineering (notice that the project icon is changed, and MyEclipse automatically relies on Jee's package).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/96/wKiom1RTsQuBfiIsAAF9SI3zoFc187.jpg "title=" m5.png "alt=" Wkiom1rtsqubfiisaaf9si3zofc187.jpg "/>

Similarly created: Src/main/webapp

At this point the project's structure is shown below:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/95/wKioL1RTsGDRMj_5AAELrXB1zaQ248.jpg "title=" m4.png "alt=" Wkiol1rtsgdrmj_5aaelrxb1zaq248.jpg "/>

Four, configure the project properties, open the project Properties panel

Add Src/main/java, Src/test/java, src/test/resources as the source folder, there is no need to detail it, click "Add Folder" on the line.

The "Default output folder" of the minimum face is modified to "mywebapp/src/main/webapp/web-inf/classes"---this is important.

Modify the output directory of these source folders, where Main/java and main/resources output to the default output folder, and Test/java and test/resources output to target/ Test-classes, (How to modify the---click on the output Folder under each node, then click on the right of the Edit button on the line) The final result is as follows:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/95/wKioL1RTskCSiy6TAAO7RjUJtzg385.jpg "title=" M6.png "alt=" wkiol1rtskcsiy6taao7rjujtzg385.jpg "/>

Myeclipse-->web

This one is used to modify the Web features of the setup project, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4D/96/wKiom1RTslaSV7lfAAOJIRPYBSU855.jpg "title=" M7.png "alt=" wkiom1rtslasv7lfaaojirpybsu855.jpg "/>


Five, configuration Pom.xml

<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/xsd/ Maven-4.0.0.xsd "><modelVersion>4.0.0</modelVersion><groupId>springMVC</groupId>< Artifactid>springmvc</artifactid><version>0.0.1-snapshot</version><packaging>jar </packaging><name>springMVC</name><url>http://maven.apache.org</url>< Properties><project.build.sourceencoding>utf-8</project.build.sourceencoding></properties ><dependencies><dependency><groupId>org.springframework</groupId><artifactId> Spring-web</artifactid><version>4.0.6.release</version></dependency><dependency> <groupid>junit</groupid><artifactid>junit</artifactid><version>4.11</version ><scope>test</scope></dependency><dependency><groupid>javax.servlet</groupid><artifactid>servlet-api</ Artifactid><version>2.5</version></dependency><dependency><groupid> org.springframework</groupid><artifactid>spring-aspects</artifactid><version>4.0.6. Release</version></dependency><dependency><groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid><version>4.0.6.release</version></dependency ><dependency><groupId>org.springframework</groupId><artifactId> spring-context-support</artifactid><version>4.0.6.release</version></dependency>< dependency><groupid>org.freemarker</groupid><artifactid>freemarker</artifactid>< version>2.3.20</version></dependency><dependency><groupid>commons-logging</ Groupid><artifactid>commons-logging</artIfactid><version>1.2</version></dependency><dependency><groupid>commons-lang </groupid><artifactid>commons-lang</artifactid><version>2.6</version></ Dependency><dependency><groupid>org.springframework</groupid><artifactid> spring-mock</artifactid><version>2.0.8</version><scope>test</scope></ Dependency><dependency><groupid>log4j</groupid><artifactid>log4j</artifactid> <version>1.2.14</version></dependency><dependency><groupid>org.mybatis</ Groupid><artifactid>mybatis</artifactid><version>3.2.7</version></dependency> <dependency><groupid>org.mybatis</groupid><artifactid>mybatis-spring</artifactid ><version>1.2.2</version></dependency><dependency><groupid>mysql</groupid ><artifactid>mysql-connector-java&lT;/artifactid><version>5.1.32</version></dependency><dependency><groupid> Org.springframework</groupid><artifactid>spring-tx</artifactid><version>4.0.6.release </version></dependency><dependency><groupId>org.springframework</groupId>< Artifactid>spring-jdbc</artifactid><version>4.0.6.release</version></dependency> <dependency><groupid>org.apache.commons</groupid><artifactid>commons-collections4</ Artifactid><version>4.0</version></dependency><dependency><groupid> Commons-dbcp</groupid><artifactid>commons-dbcp</artifactid><version>1.4</version ></dependency><dependency><groupId>commons-pool</groupId><artifactId> commons-pool</artifactid><version>1.6</version></dependency><dependency>< Groupid>org.springframework</groupid><artifactid>spring-test</artifactid><version>4.0.6.release</version><scope>test </scope></dependency><dependency><groupId>net.sf.json-lib</groupId>< artifactid>json-lib</artifactid><version>2.4</version><classifier>jdk15</ Classifier></dependency><dependency><groupid>org.activiti</groupid><artifactid >activiti-engine</artifactid><version>5.16.3</version></dependency><dependency ><groupid>org.activiti</groupid><artifactid>activiti-spring</artifactid><version >5.16.3</version></dependency><dependency><groupid>org.apache.openejb</groupid ><artifactid>javaee-api</artifactid><version>5.0-1</version><scope>provided </scope></dependency><dependency><groupid>javax.faces</groupid><artifactid >jsf-api</artifactid><version>1.2_04</version><scope>provided</scope></dependency><dependency>< groupid>javax.servlet</groupid><artifactid>jstl</artifactid><version>1.2</ Version><scope>provided</scope></dependency><dependency><groupid> Javax.servlet.jsp</groupid><artifactid>jsp-api</artifactid><version>2.1</version ><scope>provided</scope></dependency><dependency><groupid>javax.faces</ Groupid><artifactid>jsf-impl</artifactid><version>1.2_04</version><scope> Provided</scope></dependency><dependency><groupid>io.janusproject.guava</groupid ><artifactId>guava</artifactId><version>17.0</version></dependency>< dependency><groupid>com.google.code.gson</groupid><artifactid>gson</artifactid>< Version>2.3</version></dependency><d Ependency><groupid>org.apache.commons</groupid><artifactid>commons-io</artifactid ><version>1.3.2</version></dependency><dependency><groupid>commons-fileupload </groupId><artifactId>commons-fileupload</artifactId><version>1.3.1</version> </dependency><dependency><groupid>com.mchange</groupid><artifactid>c3p0</ Artifactid><version>0.9.5-pre8</version></dependency></dependencies></project >



This article is from the "dream to think XI" blog, please be sure to keep this source http://qiangmzsx.blog.51cto.com/2052549/1570610

MyEclipse + MAVEN Development SPRINGMVC detailed configuration process for Web engineering

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.