With maven, I occasionally hit an artifact that comes from some 3rd-party repo that I haven\'t built or included in my repository yet.
I\'ll get an error message fr
If you use Nexus as a proxy repo, it has "Not Found Cache TTL" setting with default value 1440 minutes (or 24 hours). Lowering this value may help (Repositories > Configuration > Expiration Settings).
See documentation for more info.
you can delete the corresponding failed artifact directory in you local repository. And also you can simply use the -U
in the goal. It will do the work. This works with maven 3. So no need to downgrade to maven 2.
In my case the solution was stupid: I just had incorrect dependency versions.
I used to solve this issue by deleting the corresponding failed to download artifact directory in my local repo. Next time I run the maven command the artifact download is triggered again. Therefore I'd say it's a client side setting.
Nexus side (server repo side), this issue is solved configuring a scheduled task.
Client side, this is done using -U
, as you already pointed out.
While you can resolve this with a clean install (overriding any cached dependencies) as @Sanjeev-Gulgani suggests with mvn -U clean install
You can also simply remove the cached dependency that is causing the problem with
mvn dependency:purge-local-repository -DmanualInclude="groupId:artifactId"
See mvn docs for more info.
You need to delete all "_maven.repositories" files from your repository.