Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven variable for reactor root

Tags:

maven-2

In a multi-module maven project, is there a variable that points to the root project folder?

  • ${project.basedir} points to the current project's directory,
  • ${project.parent.basedir} points to the parent project's directory,

but is there a variable that always points to the root directory (the one from which the maven command was executed), no matter from which project inside the reactor?


I realized that the problem I wanted to solve is pretty much unsolvable. I wanted a variable that pointed to either project.basedir, project.parent.basedir, project.parent.parent.basedir etc, whichever is higher. But since a project's parent pom need not be it's parent in the file system, my whole approach won't help. So I am accepting Pascal's answer because it answers my question (even if my question does not solve my problem).

like image 343
Sean Patrick Floyd Avatar asked Nov 10 '10 16:11

Sean Patrick Floyd


1 Answers

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.

like image 144
Pascal Thivent Avatar answered Sep 20 '22 16:09

Pascal Thivent