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

MAVEN_BASEDIR Default Location #18

@vjkoskela

Description

@vjkoskela

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions