Maven 在依赖项之间共享属性
是否可以在两个依赖项之间共享属性 这是我的布局:Maven 在依赖项之间共享属性,maven,dependencies,Maven,Dependencies,是否可以在两个依赖项之间共享属性 这是我的布局: PARENT (can't change this) - proj A (Can't change this either - has a lot of properties) - proj B (Need to specify which version of proj A I will use when compiling this) 所以我把它改成: PARENT - proj A - proj B
PARENT (can't change this)
- proj A (Can't change this either - has a lot of properties)
- proj B (Need to specify which version of proj A I will use when compiling this)
所以我把它改成:
PARENT
- proj A
- proj B (no longer a son of proj A and now importing proj A as dependency of scope import type pom)
问题是我现在已经丢失了项目A的属性,我需要在项目B中访问这些属性
你能找到解决办法吗
提前感谢。共享属性的唯一方法是使用继承。由于无法更改
父项
,因此解决方案是为项目A
和项目B
创建一个中间父项pom
由此产生的布局将是:
PARENT
COMMON_PROPERTIES_PARENT (with properties used by proj A and proj B)
- proj A
- proj B (no longer a son of proj A and now importing proj A as dependency of scope import type pom)
我将无法在项目A中重用属性,但我想我至少可以复制它们。=)