I currently have a pom with platform specific profiles (e.g. linux 32bit, windows 64 bit, etc...). Additionally, I have set it up to automatically choose the invoker's platform as a default.
Now, assume I am in a linux 32 machine: I also want to build for win64 by invoking mvn -Pwin64 pakage
but in doing so, both the linux32 and win64 profiles get activated. I have tried activating the local platform profile with activeProfiles
and using ativation
tags. The trouble is that -P does not disable all other profiles as explained in the documentation:
This option takes an argument that is a comma-delimited list of profile-ids to use. When this option is specified, no profiles other than those specified in the option argument will be activated.
Am I understanding this wrong? How would you handle this?
Note: I know I could run mvn -P-linux32,win64
but that is only valid on linux32 platforms, and any mistakes may result in a bloated build with duplicate classes.
Thanks!