When running mvn install
on a local multi module project it builds and install the projects artifacts into the local repo. mvn clean
seems to clean up my project specific target directories.
What command do I use with maven to get it to uninstall my projects modules from the local repo? for example my projects outputs foo-0.1.jar and bar-0.2.jar I want those removed from my local repo without having to go in there and delete them myself.
If you want to explicitly remove a single artifact from the cache, use purge-local-repository with the manualInclude parameter. For example, from the command line: mvn dependency:purge-local-repository -DmanualInclude="groupId:artifactId, ..."
To clear/delete your local maven repository cache, simply delete the . m2/repository folder. The local repository path can also be configured in Maven setting. xml (either the global or the user one).
When running mvn install on a local multi module project it builds and install the projects artifacts into the local repo. mvn clean seems to clean up my project specific target directories.
Local maven repository is just a directory located in $HOME/. m2/repository/ . Locate your library there and just remove the directory where the files are stored.
mvn build-helper:remove-project-artifact
You can purge artifacts from your local repository, but why do you like to do this? Apart from that you can do that via maven-dependency-plugin:
This will purge all project- and dependency artifacts
mvn dependency:purge-local-repository -DreResolve=false
This can be influenced by supplemental command line arguments (see the documentation) for further details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With