Exclude dependency in a profile

后端 未结 6 1841
别那么骄傲
别那么骄傲 2021-02-06 23:49

I have a maven module which has some dependencies. In a certain profile, I want to exclude some of those dependencies (to be exact, all dependencies with a certain group id). Th

6条回答
  •  生来不讨喜
    2021-02-07 00:51

    Bit dirty but lightweight solution is to use import.

    Unlike the other scopes you could use this:

    • will disable compile-time and runtime dependecies; unlike provided or runtime which disables only one at a time
    • won't mess up your test scope
    • you don't need to specify path to some dummy jar as would system scope require

    Nothing gets imported as long as you use this hack outside dependencyManagement.

提交回复
热议问题