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 Apache under the project,: 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, add <localRepository> your local warehouse address </localrepository> between the <settings></settings> tags; I put it under the H:/maven3/repository, as follows:

[HTML]View PlainCopy
  1. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/ Settings-1.0.0.xsd ">
  4. <!--localrepository
  5. | The path to the local repository maven would use to store artifacts.
  6. | The following is the default local warehouse address
  7. | Default: ~/.m2/repository
  8. <localrepository>/path/to/local/repo</localrepository>
  9. -->
  10. <!--custom Local warehouse address --
  11. <localrepository>h:/maven3/repository</localrepository>
  12. </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.