Starting with Maven 2.0.10, one or more profiles can be deactivated using the command line by prefixing their identifier with either the character '!' or '-' as shown below:
This can be used to deactivate profiles marked as activeByDefault or profiles that would otherwise be activated through their activation config.
As noted by @Calfater in the comments, the exclamation mark needs to be escaped in most shells (bash, zsh, and others on Linux and MacOS), though not on the windows command line.
The escape mechanisms are shell-dependant, but usually you can do :
Starting with Maven 2.0.10, one or more profiles can be deactivated using the command line by prefixing their identifier with either the character '!' or '-' as shown below:
This can be used to deactivate profiles marked as activeByDefault or profiles that would otherwise be activated through their activation config.
Refer Maven Doc
Because ! Exclamation mark is a special character for most of the command line tools, you might need to escape it refer here.