有没有办法在java程序中获取maven settings.xml
文件的路径,例如从默认系统属性或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
访问maven.home
System.getenv("M2_HOME");
访问user.home
System.getProperty("user.home");
关于java - 如何以编程方式获取maven settings.xml的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47747849/