June 6, 2008

Set global Maven command line options

We can set global command line options for Maven in Windows by creating a file called mavenrc_pre.bat in our %USERPROFILE% directory. This batch file will be executed by the mvn.bat command. So for example we can add set MAVEN_OPTS=-Xmx256M to the file and this will be added to the command line automatically each time we invoke mvn.bat.