简体   繁体   English

Spring Tool Suite中maven使用的settings.xml在哪里?

[英]Where is the settings.xml used by maven in the Spring Tool Suite?

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 我想设置用于从STS部署的ftp服务器,如下所述: http//maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

It should be in the settings.xml. 它应该在settings.xml中。 According to documentation settings is in either of 2: 根据文档设置是2:

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

Where is the $M2_HOME. $ M2_HOME在哪里? In other terms when working from STS(Eclipse), what is the installation folder for maven in this case. 换句话说,在使用STS(Eclipse)工作时,maven的安装文件夹是什么。 I can't find a settings.xml in ${user.home}/.m2/ . 我在$ {user.home} /.m2 /中找不到settings.xml。 I worked under Windows 7 我在Windows 7下工作

Those 2 threads are related but do not provide a clear answer that worked for me at least: 这2个线程是相关的,但没有提供一个至少对我有用的明确答案:

Thx in advance Thx提前

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. 我可能不合适,因为我自己从未使用过STS,但如果我理解正确,它只是一个预先打包的Eclipse发行版。 If I'm correct your installation only contains an embedded version of Maven, but not a command line accessible one. 如果我是正确的,您的安装只包含嵌入版本的Maven,但不包含命令行可访问的版本。 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. 使用Eclipse的3.x版本,我发现您需要将安装指向Eclipse的外部Maven安装,以便使用settings.xml文件。 Once you installed a downloaded version you can choose Window -> Preferences -> Maven -> Installations , press Add... and point to the version you just installed. 安装下载的版本后,您可以选择Window -> Preferences -> Maven -> Installations ,按Add...并指向刚刚安装的版本。

Global maven settings.xml exist at apache-maven-3.0.4\\conf\\settings.xml [inside the maven installation] 全局maven settings.xml存在于apache-maven-3.0.4\\conf\\settings.xml [maven安装内部]

and

Local maven settings.xml exist at C\\Users\\[username]\\.m2\\settings.xml [window OS install on C drive] 本地maven settings.xml存在于C\\Users\\[username]\\.m2\\settings.xml [窗口操作系统安装在C盘上]

In Spring Tools Suite (3.6.1): 在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. Windows - 首选项 - Maven - 用户设置,您可以选择要使用的settings.xml的全局和用户版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM