How to activate a Maven profile in a dependent module?

前端 未结 2 1912
南旧
南旧 2020-12-18 23:17

Suppose I have a module A:jar, whose runtime and compilation set of dependencies depends on the JDK version. In my example, I have a pre-jdk6-profile

2条回答
  •  失恋的感觉
    2020-12-18 23:58

    Several notes way after the fact:

    1. When you use -P profName, it activates a profile named 'profName'
    2. After that, it disables all profiles that have an tag for them. It doesn't matter whether they are activated by the java version, as in the example, or by default or env value or anything.
    3. That means the -P causes any otherwise activated profile to become deactivated.

    Solution: Either use ... or use -P but do not use both.

提交回复
热议问题