Install the M2eclipse plugin in maven and eclipse under Windows

Source: Internet
Author: User

as a successful open source project in the Apache organization, MAVEN primarily serves the Java platform-based project building, dependency management, and project information management.
First, install MAVEN on the window1. Jdk,maven can be run in JDK1.4 and above prior to installing MAVEN correctly.
Echo%java_home%java-version
2. Download maven
http://maven.apache.org/download.cgi, select the corresponding version apache-maven-3.2.5-bin.zip or Apache-maven-3.2.5-src.zip, which contains the source code.
3. Local Installation
Unzip the Apache-maven-3.2.5-bin.zip to a specified location, such as D:\maven\apache-maven-3.2.5. Create a new variable in the system environment variable m2_home, the variable value is the MAVEN installed directory D:\maven\apache-maven-3.2.5. Then append the%m2_homw%\bin at the end of the system environment variable path;. Note that multiple values are separated by semicolons.
4. Check the installation status
Echo%m2_home%mvn-v
Second, upgrade mavenupdating Maven on window is simple, just download the new installation file, unzip it to a local directory, and update the M2_HOME environment variable.
Three, installation directory analysis1. Bin: Contains scripts run by MVN that are used to configure Java commands, prepare classpath and related Java System Properties, and execute Java commands.
2. Boot: Contains the Plexus-classworlds-2.5.2.jar loader framework, MVN uses the framework to load its own class library.
3. conf: This directory contains setting.xml. By modifying the file directly, you can specify the MAVNE behavior globally on the machine. In general, we prefer to copy the file to the ~/.m2/directory (~ represents the user directory) and then modify the file to specify the behavior of the Mavne in the user scope. This approach facilitates subsequent upgrades.
4. lib: This directory contains the Java class libraries required by the MVN runtime.
iv. setting up an HTTP proxyAdd the following code in the ~/.m2/settings.xml file;
<proxies>     <proxy>      <id>my-proxy</id>      <active>true</active>      <protocol>http</protocol>      
Active;true representative activates the agent
Protocol: Proxy Protocol
Host: hostname
Port: Port number
Nonproxyhosts: Specifies that those hosts do not need to use proxies
v. Installation of M2eclipse1. Start Eclipse, select Help from the menu, then select Install New software ..., then a dialog box will appear, click the Add button on the work with: A new Add Repository dialog box will pop up. Enter M2E in the Name field and enter Http://download.eclipse.org/technology/m2e/releases in the location. then click OK.
or click the Eclipse menu bar help->eclipse Marketplace search keyword maven to plug-in MAVEN integration for Eclipse and click Install to
2. After downloading the above resources, M2eclipse's core module, MAVEN integration for Eclipse (Required), is displayed, then click the Next button.
3. Eclipse automatically calculates inter-module dependencies, and after confirming the error, click Next.
4. M2eclipse license information appears, click I Accept ...
5. Finish, restart Eclipse
6. File--New--and other find Maven, select Maven Project

In addition to the core plug-ins above, the installation address for other components is: http://m2eclipse.sonatype.org/sites/ This error may be reported when M2e-extras

is used: "eclipse is running in a JRE, but a JDK is required "
This is because eclipse runs on the JRE by default, and some features of m2eclipse require the use of JDK. Workaround when configuring the Eclipse.ini file for the Eclipse installation directory, add the VM configuration to the JDK.
--launcher. Xxmaxpermsize256m-vmc:\program files\java\jdk1.6.0_37\bin\javaw.exe-vmargs-dosgi.requiredjavaversion=1.5- xms40m-xmx512m
vi. Mavne Installation Best Practices1. Set the MAVEN_OPTS environment variable, the recommended way is to set the maven_opts as an environment variable, once enacted, once and for all.
It is often necessary to set the value of Maven_opts to-xms128m-xmx512m, because the default maximum available memory for Java is often not sufficient to meet the needs of MAVEN operations, such as building a project site with Maven when the project is large, requiring a lot of memory, if not, It is easy to appear Java.lang.OutOfMemeoryError. Therefore, it is recommended to configure the variable at the outset.
2. Do not use the IDE inline MAVEN
Click Windows---Preferences, expand Maven items, select Installation, click on the right Add, select mvn install directory M2_home-Add complete, select the external mav you just added En
Vii. Exception HandlingThis exception is reported by Eclipse Indigo when installing MAVEN plugin maven integration for Eclipse.
Workaround:
1. Help--Install New software ...
2. Work with fill in: http://www.fuin.org/p2-repository/, there will be a load time, search box fill in the SLF, and then press the Next ... Can

3. The process may be prompted to restart, restart after the installation of the M2E plug-in.

viii. link Mode (custom mode)1. Create two folders in the root directory of your eclipse installation: Links,mavenplugins (folder name customizable)
2. Put the eclipse-maven3-plugin.7z features and plugins folder into the Mavenplugins folder (this must be the case, note the folder after the decompression of the nested situation).
3. In the links directory, create a maven.link (file name customizable) file, open and enter: Path=mavenplugins folder absolute Path (Note that the folder path is "/" or "\ \" instead of "\").
4. Restart Eclipse, after launch you open window---> Preferences will find one more option Maven, indicating that the installation was successful.


Install the M2eclipse plugin in maven and eclipse under Windows

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.