Reputation: 18465
Ive got a Maven project ive inherited which has no profiles setup, however I need to set different different profiles for dev/int/staging etc.
From what ive read I can put in profile elements into the main POM but there are alot of dependency configuration elements so this file would become huge, so I was wondering if there was a way of telling the main POM to reference different files, so it would be something like:
Im assuming its not possible and I just have to deal with a huge POM, but thought I would ask in case it is possible.
Upvotes: 2
Views: 1070
Reputation: 8876
Profiles can be placed either inside the POM, or outside in Settings. You're much better off keeping machine specific settings outside of the POM (as you note), but you can't include dependencies (as far as I know) in settings.
I've had to include things like native libraries as dependencies and have successfully used profiles, but did have to use the POM. (NOTE though, this is one of the only reasons I can think of to need to include deps in a profile, generally you shouldn't, and if possible you'll want to avoid it because those parts of the build become non-deterministic.)
To cut down on the size of the POM you can use inheritance. You can make separate POMs for each machine that use a common parent that has all the common stuff in it. Be careful though, inheritance can affect the way profiles are activated. Use the Help plugin to see the "effective POM" (and or effective-settings) to troubleshoot this.
Upvotes: 3