Reputation: 24791
mvn
command, among others, have following options:
-f,--file <arg>
Force the use of an alternate POM file. (This is for pointing file instead of default pom.xml
file.)-gs,--global-settings <arg>
Alternate path for the global settings file. (This one is for pointing the settings.xml
file, which is by default in .m2
directory.)Still there is yet one config file uncovered by these options - .mavenrc
So, my question is - Is there a way to tell maven from which file it should get MAVEN_OPTS
?
Upvotes: 3
Views: 13368
Reputation: 13101
Starting with Maven 3.3.1, you can put these settings into the .mvn/maven.config
file in your project repository.
References:
Upvotes: 6
Reputation: 17874
MAVEN_OPTS is a environment variable from the OS. You can set it anyway you want before launching maven.
In bash (linux):
export MAVEN_OPTS=...
On windows:
set MAVEN_OPTS=...
I think you could even edit the 'mvn' of 'mvn.bat' shell script to get different variables.
Upvotes: 7