De-activate a maven profile from command line

后端 未结 3 629
我在风中等你
我在风中等你 2021-01-31 13:09

I have a profile activated by default in my maven setting file ~/.m2/settings.xml.

Is it possible to deactivate it from the command lin

3条回答
  •  没有蜡笔的小新
    2021-01-31 13:56

    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:

    mvn groupId:artifactId:goal -P !profile-1,!profile-2
    

    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.

提交回复
热议问题