I have just edited the <repositories />
section of my pom.xml
file for a project, removing a couple of repo's I thought were unneeded.
I'd like to validate that the declared dependencies are still resolvable in the available repositories.
However, all of the declared dependencies are available in my local repo, so any attempt to build will just use the local ones.
I don't want to simply nuke my local repo, as it takes many hours to download all the dependencies from scratch.
Similarly, I'm not interested in having maven attempt to download all the dependencies, I just want it to ensure that they're all resolvable (including transitive dependencies).
How do I do this?
Maven local repository is located in your local system. It is created by the maven when you run any maven command. By default, maven local repository is %USER_HOME%/. m2 directory.
Force maven to fetch dependencies from the remote repository while building the project. We can use -U/--update-snapshots flag when building a maven project to force maven to download dependencies from the remote repository.
run
mvn dependency:analyze
it will check dependencies for you.
ref: http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html
The first thing i can say is not to define repositories in a pom, cause it will cause many problems in particular for others who are using this project. Furthermore i recommend to use a repository manager which will solve the problem and improve performance during download and will simplify the check of such circumstances which means simply delete the local repo and try to build.
Emptying the local repo seems to be the only option. This link may help prevent maven to resolve dependencies in local repository.
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