6

I'd like to set the ftp servers for deploying from STS as described here: http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

It should be in the settings.xml. According to documentation settings is in either of 2:

  • The Maven install: $M2_HOME/conf/settings.xml
  • A user's install: ${user.home}/.m2/settings.xml

Where is the $M2_HOME. In other terms when working from STS(Eclipse), what is the installation folder for maven in this case. I can't find a settings.xml in ${user.home}/.m2/ . I worked under Windows 7

Those 2 threads are related but do not provide a clear answer that worked for me at least:

Thx in advance

Community
  • 1
  • 1
isaac.hazan
  • 3,772
  • 6
  • 46
  • 76
  • I believe I had to set the $M2_HOME as a "Linked Resource" in Preferences -> General -> Workspace -> Linked Resource. However, the ${user.home} should work as-is. – CodeChimp Feb 03 '14 at 20:52

3 Answers3

8

I may be off-mark as I've never used STS myself, but if I understand correctly it is just a pre-packaged Eclipse distribution. If I'm correct your installation only contains an embedded version of Maven, but not a command line accessible one. You need to install one from here.

With the 3.x releases of Eclipse I found that you need to have your installation point to an external Maven installation for Eclipse to make use of the settings.xml files. Once you installed a downloaded version you can choose Window -> Preferences -> Maven -> Installations, press Add... and point to the version you just installed.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55
  • I did not install any version it comes built-in with STS. – isaac.hazan Feb 03 '14 at 21:08
  • That's my point. The build in version can only be used from within Eclipse, but not from the command line. Even the Maven related `Run as...` commands should not run in your installation. If I were you I'd also install a free-standing Maven and have Eclipse point to it. – Nicola Musatti Feb 03 '14 at 21:12
7

In Spring Tools Suite (3.6.1):

Windows - Preferences - Maven - User Settings, you can select which global- and user- version of the settings.xml to use.

4

Global maven settings.xml exist at apache-maven-3.0.4\conf\settings.xml [inside the maven installation]

and

Local maven settings.xml exist at C\Users\[username]\.m2\settings.xml[window OS install on C drive]

Kick
  • 4,823
  • 3
  • 22
  • 29