Maven variable for reactor root

后端 未结 7 1714
攒了一身酷
攒了一身酷 2020-12-07 22:41

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 d
7条回答
  •  醉酒成梦
    2020-12-07 22:48

    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

提交回复
热议问题