问题:
我有一个 Maven 项目,其结构类似于以下示例:
(为了解释方便进行了简化)
Only B1 and B2 need to be built using a specific profile that includes additional build materials. As a result, the profile has been defined in module B. Logically, the modules belong to module B and also inherit some dependencies through aggregation and inheritance. (Imagine something like B=Frontend, B1=UI, B2=Themes, B3=Something else)
我有一个 Maven 项目,其结构类似于以下示例:
(为了解释方便进行了简化)
--parent
|-- child A (inherits from parent)
|-- child B (inherits from parent)
|-- child B1 (inherits from B)
|-- child B2 (inherits from B)
|-- child B3 (inherits from B)
Only B1 and B2 need to be built using a specific profile that includes additional build materials. As a result, the profile has been defined in module B. Logically, the modules belong to module B and also inherit some dependencies through aggregation and inheritance. (Imagine something like B=Frontend, B1=UI, B2=Themes, B3=Something else)
问题
- 是否有可能仍然使用来自父POM的完整构建,并仅在正确的子模块中激活相应的配置文件?(这将是我最喜欢的解决方案)
- 还是需要使用高级反应堆选项(-pl等)进行单独的构建?
- 或者对于这种情况是否有完全不同的方法?
编辑
由于问题被识别为重复,因此进行了编辑: 问题在于,根据相应问题提到的解决方案不起作用。
如果我使用属性激活子配置文件,那么它也将被激活模块B(父级)和所有子级。
我只想要它在子级B1和B2中激活。