exempt one module from maven enforcer plugin

46 Views Asked by At

I have a multi module maven project. Some of the modules require dependency D. In order for things to work right, we need compat to come BEFORE D in the class path. (Module D comes from maven central, whereas compat is one of the modules in our multi-module project.) If compat comes after D or is omitted entirely, things seems to work, but actually don't.

Rather than trying to make everyone remember to always pull in both modules, I thought I'd do two things:

  1. pull in D as part of compat. This helps, but not much. Now people still remember to avoid D and use compat instead. But at least the pom.xml file is a bit more concise.
  2. Use the maven enforcer plugin to ban D. Then if someone forgets, the build fails and they get a reminder.

The problem with part 2 is that the compat module itself needs to import D. So I need to make an exception for it. Any idea how to do that?

0

There are 0 best solutions below