shabunc
shabunc

Reputation: 24791

How to tell maven to get MAVEN_OPTS from specific file?

mvn command, among others, have following options:

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

Answers (2)

joschi
joschi

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

GeertPt
GeertPt

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

Related Questions