Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven tries to download dependency despite it existing in local repository

Tags:

maven-2

I have an installed dependency in my local repository. The remote repository where the dependency came from is now down for some reason. When I try to compile the project Maven says that it can't resolve dependency. But why???

like image 861
michael nesterenko Avatar asked Mar 11 '11 10:03

michael nesterenko


People also ask

Why does maven always download dependency?

When you run a Maven build, then Maven automatically downloads all the dependency jars into the local repository. It helps to avoid references to dependencies stored on remote machine every time a project is build. Maven local repository by default get created by Maven in %USER_HOME% directory.

Why maven try to download locally exist jars?

For some reason it could be that the jar is found there, but the pom is not. If this is not the case, you have some kind of mismatch between the local repository when maven runs and when you install the jar from console, but I can't figure out how. yes problem jregex-1.2_01.

Does maven automatically download compile dependencies?

No need to download all those. Maven will take care of all the artifact's dependencies for the specified dependency mentioned in pom file.


1 Answers

When you have these error, simply clean the _remote.repositories that indicate maven where the dependency comes from. You will find this file for each artifact inside your M2_REPO.

like image 154
NoDataFound Avatar answered Nov 14 '22 18:11

NoDataFound