I know that there are few questions already about dependency:purge-local-repository
to clean up the local repository dependency cache.
Almost all posts say this command will remove all dependencies but it seems not... Especially "test" scope dependencies remain and I can't clean up the local repo.
I debugged this plugin a bit and why this happens.
Then eventually I found that the getFilteredResolvedArtifacts
method in the PurgeLocalRepositoryMojo
calls MavenSession.getProjectBuildingRequest()
method and this ProjectBuildingRequest
has an exclude for test
& provided
scopes in the buildingRequest.repositorySession.dependencySelector
Screenshot of debugging => debug screenshot
I would like to know if this plugin intentionally excludes test dependencies to purge (if so, the reason as well..) I wanted to rise a github issue for that (https://github.com/apache/maven-dependency-plugin) but I couldn't find issue page there.
Thanks a lot for the support in advance!