8

In order to use the tomcat 7 manager (or mvn tomcat:deploy), I need to put a settings.xml file somewhere.

The file will contain the following:

<server>
    <id>myserver</id>
    <username>myusername</username>
    <password>mypassword</password>
</server>

Where does this file go?

Does it need to be explicitly referenced somewhere?

Liam
  • 1,041
  • 2
  • 17
  • 31
  • 2
    use tomcat7:deploy. And have a look here [http://stackoverflow.com/questions/13336816/tomcat7-maven-plugin-tomcatmanager-status-code403-reasonphraseforbbiden][1] [1]: http://stackoverflow.com/questions/13336816/tomcat7-maven-plugin-tomcatmanager-status-code403-reasonphraseforbbiden – Olivier Lamy Mar 18 '13 at 00:53

1 Answers1

13

The settings.xml file is part of the maven settings and is not specific to tomcat, though the tomcat-maven-plugin uses the servers defined there.

There are two locations where a settings.xml file may live:

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

The former settings.xml are also called global settings, the latter settings.xml are referred to as user settings. If both files exists, their contents gets merged, with the user-specific settings.xml being dominant.

You can find the exact syntax for defining servers in the settings documentation.

Community
  • 1
  • 1
kapex
  • 28,903
  • 6
  • 107
  • 121