查找多模块maven reactor项目的根目录
我想使用maven-dependency-plugin从我的多模块项目的所有子模块复制EAR文件到一个相对于整个项目的根目录的目录。
也就是说,我的布局看起来类似于这个,名称改变了:
to-deploy/ my-project/ ear-module-a/ ear-module-b/ more-modules-1/ ear-module-c/ ear-module-d/ more-modules-2/ ear-module-e/ ear-module-f/ ...
我希望所有的EAR文件都从各自模块的目标目录复制到my-project/../to-deploy所以我最终
to-deploy/ ear-module-a.ear ear-module-b.ear ear-module-c.ear ear-module-d.ear ear-module-e.ear ear-module-f.ear my-project/ ...
我可以在每个耳模块中使用相对path来完成,如下所示:
org.apache.maven.pluginsmaven-dependency-plugincopyinstallcopy${project.groupId}${project.artifactId}${project.version}ear../../to-deploy
但是我不想在元素中指定一个相对path。 我喜欢像${reactor.root.directory}/../to-deploy ,但我找不到像这样的东西。
另外,我宁愿如果有某种方式来inheritance这个Maven的依赖插件configuration,所以我不必为每个EAR模块指定它。
我也尝试从根pominheritance自定义属性:
${basedir}