I\'m working on a project with dependency X. X, in turn, depends on Y.
I used to explicitly include Y in my project\'s pom. However, it was not used and to make thin
Deleting the ~/.m2/repository
will solve your problem. But, if you still need to keep the old ~/.m2/repository
you can just change the maven local path temporarily.
If you are working on IntelliJ just go to Maven Settings and change the Local Repository path to somewhere else. You may need to tick the override checkbox near there.