Home > database >  How to reset the Maven repository profile to default for a particular project?
How to reset the Maven repository profile to default for a particular project?

Time:10-25

I have created a new Maven project with IntelliJ and installing the dependencies, the .m2 folder's settings.xml in my ${user.home} folder has an active profile that contains the remote repository details for an internal repository, but for the current project I need to reset all those repository details without modifying the .m2 folder's settings.xml, is there a way I can do it?

CodePudding user response:

See Maven / Introduction to build profiles – Deactivating a profile:

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,!?profile-3

or

mvn groupId:artifactId:goal -P -profile-1,-profile-2,-?profile-3

This can be used to deactivate profiles marked as activeByDefault or profiles that would otherwise be activated through their activation config.

CodePudding user response:

I would just create an additional settings-other.xml and use it for Maven on the command line (with -s settings-other.xml).

  • Related