"Getting Started with maven" using Maven on Eclipse

Source: Internet
Author: User

MAVEN Installation

To download maven on the official website, the following links:

http://maven.apache.org/download.cgi#

Choose to download binary zip archive

Unzip to local, before installing MAVEN, make sure that you have installed Jdk,cmd input java-version Verify that the JDK is installed, as follows for my native JDK version:

Set Environment variables:

The Maven_home variable is set to D:\maven\apache-maven-3.3.9, which is the downloaded MAVEN package decompression path;

Add%m2_home%\bin in front of the path variable ;

M2eclipse Installation

The eclipse version I use on this machine is as follows:

Eclipse IDE for Java developers
Version:mars.1 Release (4.5.1)

has been integrated m2eclipse, if not integrated, installation is also very simple, there are two ways,

Get m2eclipse and install from Eclipse Marketplace:

Install M2eclipse with Eclipse's install new software, such as

After installing the m2eclipse, we typically do not use the eclipse-brought maven, but instead use the externally installed MAVEN version of our own, which you can only configure on Eclipse, as shown in

Start using MAVEN to manage project

Points:

    • Create a new STRUTS2 Web project that you can run
    • Modular, one parent MAVEN project + two sub maven modules
    • Build Project Site
    • Generate Test Reports
    • Generate Javadoc

First, create a new MAVEN parent project, skip the prototype selection,

Select Pakaging as Pom

Then right-select Maven on the parent project and create a new module Webapp-core,

Continue with new module Webapp-web

At this point, we have a parent project and two sub-modules, as shown in the project:

Next began to write the various modules of the demo code and POM files, here is not detailed, interested in directly download the project code, as follows:

Http://files.cnblogs.com/files/chenpi/webapp.zip

Run the Web project

Right-click to run, goals set to Tomcat7:run, the effect is as follows:

View Project Site

Right-click to run, goals set to site, the effect is as follows:

You can view project overview, project members, project-dependent jar packages, etc.

To view the test report:

View Java doc

"Getting Started with maven" using Maven on Eclipse

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.