Create a Java Project Detail plot after eclipse integrates Maven3

Source: Internet
Author: User

1. Create a Java project

1) File--->new--->other--->maven--->maven Projet

2) Select Maven-archetype-quickstart

            

3) Enter information for the project

            

4) The resulting Java project package structure is as follows

                   

5) Modify Pom.xml to specify the JDK version at compile time

<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>cn.luxh.app</groupId> <artifactid>my-app </artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name >my-app</name> <url>http://maven.apache.org</url> <!--Specify Properties--<properties> < Junit.version>4.10</junit.version> <project.build.sourceencoding>utf-8</      project.build.sourceencoding> <jdk.version>1.6</jdk.version> </properties> <build> <plugins> <!--specifying the compiled version of the JDK--<plugin> <groupid>org.apache.maven.pl   Ugins</groupid> <artifactId>maven-compiler-plugin</artifactId>           <version>2.5.1</version> <configuration> <source>${jdk.ve Rsion}</source> <target>${jdk.version}</target> <showwarnings>tr   ue</showwarnings> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactid>junit</ar tifactid> <version>${junit.version}</version> <scope>test</scope> </dependency&  Gt </dependencies></project>

  2. Create a Web project

1) File--->new--->other--->maven--->maven Projet

2) Select Maven-archetype-webapp

            

3) Fill in the project information

            

4) Production of Web project package structure

              

4.1) Convert the project to a Dynamic Web Module, right-click on the project, select Properties, then select Project Facets, then click Convert to Faceted form ...

Tick dynamic Web Module, select 3.0 to support servlet3.0

Tick Java, select JDK version 1.6 or higher

4.2) The tool only generates a source folder called Src/main/resource, and we need to manually add Src/main/java, Src/test/java, and Src/test/resource three source folder, right-click New---->source folder on the project and enter the folder name.

4.3) Modify the compilation path of the source folder, go to the Java Build Bath window, double-click the output folder under each of the folders to specify the path.

Src/main/java and Src/main/resource Specify Target/calsses,src/test/java and Src/test/resource specify target/test-classes

Select the Allow output folders for source folders.

4.4) Configure the deployment of the program deployment Assembly, delete the test of the two items, test of the program is not required when the release, add Maven dependency library, release can be published to the Lib directory, add/src/main/ WebApp the root directory for the deployment

5) Configure TOMCAT7, publish run project

Create a Java Project Detail plot after eclipse integrates Maven3

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.