Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

MAVEN_BASEDIR Default Location #18

Open
vjkoskela opened this issue May 30, 2018 · 0 comments
Open

MAVEN_BASEDIR Default Location #18

vjkoskela opened this issue May 30, 2018 · 0 comments

Comments

@vjkoskela
Copy link

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant