Maven variable for reactor root

In the latest maven, you can use ${maven.multiModuleProjectDirectory}.


In Maven 3, ${session.executionRootDirectory} is "a variable that always points to the ... directory ... from which the maven command was executed."

Note that this is distinct from a property that gives the top-level root directory of a multi-module project, regardless of where in the directory structure mvn is executed from. Such a property does not exist to my knowledge, but you can use the ${basedir}/.. hack to achieve it. See this thread on maven-users for more details.

See also: Finding the root directory of a multi module maven reactor project


is there a variable that always points to the root directory (the one from which the maven command was executed)

user.dir (the working directory) should be that directory.

Tags:

Maven 2