Maven Configuration in Sts,myeclipse

Source: Internet
Author: User

In this paper, the environment of STS is explained, the MYECLIPSE environment and STS are not very different and the configuration process is similar.

STS is uncompressed, and after startup, you can see that there's already a Maven plugin,

However, STS also gives you a maven, but usually it is not recommended to use the STS self-contained MAVEN, and the other tools are the same, such as the MyEclipse Tomcat in the band I am not using, but my own uncompressed version of Tomcat. It's OK to use the default, but sometimes there may be a variety of inexplicable problems.

First, download maven and configure your custom local warehouse

This is the item under Apache, download address: http://maven.apache.org/,

After the download is complete, decompression Manen to your disk, the proposed decompression directory not too deep, I unzipped to the G:\apache-maven-3.0.5, at the same time to find the unzipped folder under the Conf settings.xml file, using a text editor to open, Modify the address of the default local warehouse, otherwise, it gives you the default local warehouse is under C:\Users\Administrator\.m2\repository, so your C disk will be bigger and larger because all the jars are downloaded to the directory. All C-Tray jar packs will be lost while reloading the system.

Modify the default local warehouse address and add <localRepository> your local warehouse address to <settings></settings> tags </ Localrepository>, I was placed 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.

ii. Configuring MAVEN environment variables

First of all, your JDK must be installed correctly and can use STS on the basic JDK correctly.

Confirm, cmd input java-version

The JDK version information is OK.  Some users enter this command, prompting: The command is not recognized. Because your path and classpath configuration is problematic, check the JDK's environment configuration first.

Then turn on the computer--system Properties--Advanced system settings, open environment variables.

Under System variables, create a new system variable named Maven_home (I get the name m3_home), address Maven to extract the address, click Save.

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

Save exit.

In the cmd input ' mvn-version ', appear the MAVEN version information OK.

Iii. Modifying the default maven in STS

Call the Window--prefences--maven of STS and check the installations option to see that there is already a default MAVEN, we don't use it, click Add, and configure our own Maven address.

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


Click Apply,ok to save Exit prefences.

By now, STS can use its own maven.

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.