Search code examples
javamavenmaven-module

How do I apply a profile to a maven module


How can I set a profile in a maven module?

This seems like a simple thing, but I'm not finding how to do it. I have a pom with modules. For certain builds, I want one module to run under a different profile.

I don't mind passing the profile into all the modules, but it is destined for one module. Just setting it in a call to the parent module, doesn't seem to do it.


Solution

  • Sorry, stupid issue. Calling -PmyProfile on the super pom does trigger the myProfile profile in the module, but only if the module's profile id hasn't been accidentally been changed to something else. Essentially, typo.