Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does settings.xml live, for tomcat 7?

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?

like image 807
Liam Avatar asked Mar 16 '13 21:03

Liam


1 Answers

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.

like image 97
kapex Avatar answered Oct 21 '22 18:10

kapex