Maven Configuration in Sts,myeclipse

Source: Internet
Author: User

In this paper, the environment of STS is explained, MyEclipse environment and STS differ little, the configuration process is similar.

STS is the decompression version, after the start, you can see already have the Maven plugin ,

However, STS also gives you a maven, but it is usually not recommended to use the STS comes with Maven, other tools are the same, such as the myeclipse in the self-contained Tomcat I do not use, but my own configuration of the decompression version of Tomcat. Using the default is also possible, but sometimes there may be a variety of inexplicable problems.

First, download maven and configure your custom local repository

It is the Apache project below: http://maven.apache.org/ ,

after the download is complete, unzip the Manen to your disk, it is recommended to extract the directory not too deep, I extracted to the G:\apache-maven-3.0.5 under the Conf folder to find the settings.xml files, using a text editor to open, Modify the address of the default local repository, otherwise it gives you the default local repository under C:\Users\Administrator\.m2\repository, so your C drive will grow larger because all the jars are downloaded to that directory, At the same time, all the C-drive jar packages will be lost when the system is re-installed.

Modify the default local warehouse address, <settings></settings> Add between Tags <localRepository> your local warehouse address </localrepository> I put it under the H:/maven3/repository, as follows:

<settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0"           xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "           xsi:schemalocation=" http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/ Settings-1.0.0.xsd ">  <!--localrepository   | The path to the local repository maven would use to store artifacts.   | The following is the default local warehouse address   | Default: ~/.m2/repository  <localRepository>/path/to/local/repo</localRepository>  -  <!--custom Local warehouse address--><localrepository>h:/maven3/repository</localrepository></settings >

Save exit.

Second, configure the MAVEN environment variable

first of all, your JDK must be installed correctly and you can use the STS on the base JDK correctly.

confirm that the cmd input java-version

the JDK version information appears ok.  Some users enter the command, prompting: The command is not recognized. Because of a problem with your path and classpath configuration, check the JDK's environment configuration first.

then turn on the computer-system Properties-advanced system settings to open environment variables.

under "System Variables", create a new system variable named Maven_home (I got the name M3_home), the address is Maven decompression address, click Save.

Modify the PATH variable and add "%m3_home%\bin".

Save exit.

In the cmd input ' mvn-version ', the MAVEN version information appears ok.

Third, modify the default maven in STS

hit STS Window--prefences--maven, check the installations option, you can see that there is already a default MAVEN, we do not use it, click Add, configure our own Maven address.

then configure user settings, and click the Users settings option to configure the settings file. Note: I have the global settings, and the user settings is the same settings.xml file, then all users are using the same configuration, because my computer has only one user, so it is configured as a global.


Click Apply,ok Save to Exit Prefences.

At this point, the STS can use its own maven.

Maven Configuration in Sts,myeclipse

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.