maven module 路径_多模块 Maven reactor项目的root目录查找_others_酷徒编程知识库

我想使用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-files都从它们各自的模块的目标目录复制到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/

...

我可以通过每个ear模块中的相对路径完成,如下所示:

org.apache.maven.plugins

maven-dependency-plugin

copy

install

copy

${project.groupId}

${project.artifactId}

${project.version}

ear

../../to-deploy

但是我不希望在元素中指定相对路径,我更喜欢这样的东西${reactor.root.directory}/../to-deploy但是我找不到这样的方法。

另外,我更喜欢继承这个maven-dependency-plugin配置,不需要为每个EAR-module指定它。

我还尝试从root pom继承一个自定义属性:

${basedir}

但是当我尝试在ear模块中使用${myproject.root}时,${basedir}将解析为ear模块的basedir。

有没有一个简单的方法来找到一个多模块项目的root?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值