Maven Start-Create a graphics tutorial for the first Web project through MAVEN

Source: Internet
Author: User

First, create the project.

It's also easy to create a MAVEN project, choose menu Item--- new--and other, select maven Projectunder Maven in the popup dialog box, and then click Next.

Create a project with Maven in 1.Eclipse

Select Mavenprojec.

2. If you want to select a working set, you can choose Add Project to Working set.

3. Choose Maven-archetype-webapp.

Enter Org.apache.maven.archetypes in the filter and select the artifact ID of Maven-archetype-webapp. Enter groupId,Artifactid,version, Package(we do not consider the Properties for the time being ).

After choosing Maven-archetype-webapp, next.

Before selecting:

When selected:

4. Fill in the appropriate information, packaged is the default to create a package, do not write or can.

GroupID large project name and Artifactid subproject name.

Before filling in:

After filling in:

GroupID:com.souvc.weixin

ArtifactID:com.souvc.test

5. Just start, you need to download some dependent packages.

Observe the Eclipse console discovery:

6. After creating the project, the directory is as follows:

At this point, the project has been created, but the configuration below.

Second, the project configuration.

1. Add Source Folder

MAVEN requires that you create the following source Folder

Src/main/resources

Src/main/java

Src/test/resources

Src/test/java

Add the above source Folder

The effect after adding:

2. Configure the Build Path to set the libraries.

Configure the dependent JDK.

The effect after configuration is complete:

After downloading the dependencies, the effect is as follows:

3. Configure the path.

Modify the output path individually:

Src/main/resources Correspondence Target/classes

Src/main/java Correspondence Target/classes

Src/test/resources Correspondence Target/test-classes

Src/test/java Correspondence Target/test-classes

7. Convert the project to dynamic WEB project

Right-click Properties on the Project

Select Project Facets on the left and click Convert faceted from on the right

Finally, modify WebContent to Webroot.

Add the deployment to Tomcat.

Access:

http://localhost:8080/com.souvc.test/

Note: Before accessing, if the default index.jsp is not added, then add an access to the index.jsp.

Maven Start-Create a graphics tutorial for the first Web project through MAVEN

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.