"Dream" Build maven Environment

Source: Internet
Author: User

First step: Download and install the configuration maven

Download the installation package: can be downloaded to the official website (may be very slow), it is recommended to download from CSDN.

Unzip the installation package: Extract to Eclipse and Java together, change the configuration of what you see at a glance; Anyway, I'm putting Java,eclipse,ext,python,django. These are all placed under the same folder, at a glance.

Configure environment variables: You can add a system variable such as M2_home, and then append to the path variable;%m2_home%\bin, how convenient it is to see a person.

Test is configured successfully:

Console input MVN-V instructions, you can see the Java JDK version, MAVEN version, JDK location, default encoding, time zone, supported operating system and other information.

  

Step two: Modify the Maven warehouse address

Modify the global Maven warehouse location:<localrepository>c:\maven3.2.1\myrepository</localrepository>

In the MAVEN directory, locate the configuration XML file and modify the Localrepository local warehouse location.

Step three: Install the Maven plugin for Eclipse

The first way: Add software support directly in Eclipse: http://m2eclipse.sonatype.org/sites/m2e

The second way: directly to CSDN or Baidu cloud disk or other places to download a plug-in package, unzip, the corresponding features and plugins copy to eclipse.

Fourth step: Copy a MAVEN configuration file into your Maven repository directory as the current warehouse profile

%m2_home%/conf/setting.xml is the global setting, all users on this computer will be affected, copy the%m2_home%/conf/setting.xml, and configure the warehouse location. For example, my directory is: C:\Maven3.2.1\myrepository

Fifth step: Setting maven_opts Environment variables

When the project is too large, prone to outofmemoryerror anomalies, so we need to modify the running content, there are the following two ways:

1) Add set maven_opts=-xms125m-xmx512m in MAVEN bin/mvn.bat

2) Add the maven_opts variable value to-xms125m-xmx512m in the environment variable

This approach is similar to modifying Eclipse, when the note parsing large file Excel, in order to read more than 40M Excel without oom error, also need to modify XMS and Xmx, these two parameters related to performance issues, reasonable adjustment can speed up the project operation.

Sixth step: Configure Maven in Eclipse

Select the path to the MAVEN package and change the warehouse address to the path configured above.

  

Seventh step: Everything is ready: Start creating a MAVEN project

Create a new Maven Project, which is the default for the first two steps.

  

The Group Id is usually the site domain name

Artifact Id is the project name

Other missing directories can be obtained by the add ... Add.

After clicking Finish, wait for a while, and the background is downloading MAVEN-related projects for you to rely on the jar package.

Here: the creation of the project is over.

  

  

"Dream" Build maven Environment

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.