-
Notifications
You must be signed in to change notification settings - Fork 5
MAVEN_BASEDIR Default Location #18
Description
Maven allows you to specify the location of the pom.xml file by using the -f argument. The directory of the pom file is also considered the base directory of the project.
-f,--file <arg> Force the use of an alternate POM
file (or directory with pom.xml).
Currently, the wrapper consider the project directory to be MAVEN_BASEDIR if set or else the first directory along the path containing a .mvn directory.
https://github.com/rimerosolutions/maven-wrapper/blob/master/mvnw#L219
It would be useful if the wrapper could detect and use the value of -f (if specified) as the project directory. This would make invoking Maven via the wrapper from another directory transparent vs just running Maven (e.g. running from /foo for a project in /bar by mvn -f /bar/pom.xmlvs//mvnw -f /bar/pom.xml`).
An alternative, would be to start the directory walk in the directory containing the mvnw script instead of the current working directory. Although it's possible there are cases where the user wants the opposite behavior (e.g. shared mvnw script).