MAVEN builds Java EE Project graphics and text tutorial _java

Source: Internet
Author: User
Tags tomcat tomcat server

I. Development environment

jdk1.7 TOMCAT7 Eclipse-jee-luna-r-win32 maven2.2.1

Second, build steps

1, click File->new->other, select Maven Project


2. Select Maven Project, click Next, and then click Next to enter the following interface


If you want to select the last one, click Next

3, see the following interface


Enter group ID and artifact ID, click Finish to complete the basic creation

4. Create a good project structure as shown in the picture (Java view)


If this is the Java EE view, see the project structure is not like this, you can replace the following as the Java view


5. Right-click the project->build path->configure build Path. Enter the following interface


Click to select the right side of the mouse to indicate the Red fork, click Remove Delete, click OK to save

6, add source folder, create a standard MAVEN Web project structure

Right-click the item->new->source folder-> to fill in the Folder name, as shown in the figure


Add Src/main/java Src/test/java src/test/resources in turn (Src/main/resources already exists)

7, the new project structure as shown in the picture


8. Configure Output path

Right-click the project->build path->configure build Path. Enter the following interface


Mouse Select Src/test/java,src/test/resources, click Edit, change the output directory is: Testdemo02/target/test-class (Testdemo for my project name)

If browse has the directory, select it; otherwise manually enter Testdemo02/target/test-class

8, update the relevant version

Right-click the project->properties->project Facets, change the JDK to a locally installed version, my 1.7;dynamic Web modul is not changed here


Locate the project location, change the Org.eclipse.wst.common.project.facet.core.xml file under the. setting file, change this row configuration <installed facet= "Jst.web" version = "2.3"/>, change version to 3.0

Update the project in Eclipse and right-click the project->properties->project Facets again to see that the dynamic Web Modul has been changed to 3.0

9. Set up the Deployment program collection

Right-click the item->properties->deployment Assembly.

Delete the two items of test because test is tested and does not need to be deployed;

Add dependencies for Maven; Add->java build Path Entires->maven dependencies->finish

The complete interface is set as follows


10, add dependent dependencies in Pom.xml, update maven project

11. Add Tomcat server to eclipse, add the project to the server, start Tomcat, and then visit the project http://localhost:8080/testDemo02/to see the familiar interface.

The above is maven to build Java EE Project detailed steps, hope to be helpful to everybody's study.

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.