Activate different Maven profiles depending on current module?

前端 未结 6 1322
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 04:05

We have a multi module build with modules using different technologies, like Java and Flex. Is it somehow possible to activate different profiles based on the module that is

6条回答
  •  旧时难觅i
    2020-12-20 04:46

    I dont know if this helps, but I solved a similar problem with the following approach:

    1. I created and described the profile in the parent POM, which has activeByDefault=false. The PluginManagement-Section then contains the configurations for different plugins.
    2. The children can reuse this profile, and set activeByDefault=true This makes the profile active, but still none of the plugins are activated.
    3. But fortunately the described plugin configurations are available. You can reuse them in children by defining them in the Plugins-Section. You just provide the group- and the artifactID, and set inherited=true for each plugin you want to reuse in the children.

    I hope that helps. Sorry for not including any code snippets, but I hope even so the soutions is understandable.

提交回复
热议问题