Eclipse builds MAVEN development environment

Source: Internet
Author: User

I learned about the MAVEN development environment and manually wrote a Maven project, but this is inefficient, and today we are learning to build a MAVEN development environment under Eclipse.

Common MAVEN Commands
    1. MVN clean: Runs a cleanup operation that deletes data from the target folder
    2. MVN Clean Compile: Runs the cleanup operation before running the compile operation, which compiles the code into the target folder.
    3. MVN Clean test: Running cleanup and testing
    4. MVN Clean Package: Run cleanup and packaging
    5. MVN clean Install: Running cleanup and installation will install the packaged files into the local repository so that other modules or projects can be configured to call the
    6. MVN Clean Deploy: Runs cleanup and publishing, which is published to the private server.
Create a project using MVN archetype

So far, we know that the Java class is stored in the fixed path "Src/main/java" folder, and the test class is stored in the "Src/main/test" folder by default, if each time you manually create these folders will be very troublesome, but fortunately, MAVEN has provided us with a "maven archetype" to build the skeleton of the project. These are fixed folders and pom.xml files.

We create a new project "test003", under the command line into the directory, enter the command: "MVN archetype:generate", you can create a project.

The first time you create a project you need to go to Maven's central repository to download something that may be slower and later, you can see the use of "MVN archetype:generate" To create the project, you will be prompted to enter some basic information about the project and what is needed in the Pom.xml file:
GroupId
Artifactid
Package
Version

You can see the basic needs of the directory and the Pom.xml file, MAVEN is automatically created for us.

Eclipse Configuration Maven Plugin

First you need to download the M2eclipse offline package, after the download is complete, the following two directories are extracted:

Restart eclipse in the corresponding directory of the Eclipse installation directory where the corresponding files in the directory's folder are copied. You can see the MAVEN option when you start clicking Window->preferences.

Configure your own Maven

So far, you need to configure your downloaded Maven into eclipse.

Configure the location of the local warehouse

M2eclipse Offline Package

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Eclipse builds MAVEN development environment

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.