Reputation: 255
Is there a way to get the path of the maven settings.xml
file in a java program like from default system property or maven options.I want to avoid getting that information from user through a configuration file.
Upvotes: 0
Views: 721
Reputation: 4564
As per the maven documentation,
There are two locations where a
settings.xml
file may live:
- The Maven install:
${maven.home}/conf/settings.xml
- A user’s install:
${user.home}/.m2/settings.xml
To access maven.home
System.getenv("M2_HOME");
To access user.home
System.getProperty("user.home");
Upvotes: 1