访问同级项目依赖项的属性 [英] Accessing a property of a sibling project dependency
问题描述
假设我有
<properties>
...
<module.deployPath>/admin</module.deployPath>
...
</properties>
在项目 A 的pom.xml中.
in the pom.xml of the project A.
现在,我想访问另一个项目 B 中的$ {module.deployPath},其中项目 A 被列为项目 B 的依赖项strong>.
And now I'd like to access ${module.deployPath} in another project B where project A is listed as dependency of project B.
是否可以在不使用外部属性文件或settings.xml的情况下实现此目的?
Is this possible somehow without using external property files or settings.xml?
谢谢您的帮助!
干杯
b
推荐答案
严格遵守Maven的属性访问机制,几乎可以肯定您不能做到这一点.如果要添加 GMaven插件并编写一些Groovy代码,则可能可以获取并解析依赖项的pom以获得所需的属性.
Staying strictly within Maven's property access mechanism, I'm almost certain you can't do that. If you were to add the GMaven plugin and write some Groovy code, then it would probably be possible to get and parse the dependency's pom to get at the property you're looking for.
这篇关于访问同级项目依赖项的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!