MVN install, cannot find artifact in local repository

user2071938 picture user2071938 · Dec 5, 2016 · Viewed 9.9k times · Source

I did mvn install and get this error message Failed to execute goal on project core: Could not resolve dependencies for project test:core:jar:2.0.1-SNAPSHOT: Could not find artifact lib-net:lib-net:jar:1.0.8 in central (http://repo.maven.apache.org/maven2)

this dependency is a Project of mine, which is available in the local repository ~/.m2

so I tried mvn install -o to force maven to use my local repository, and I get this

Failed to execute goal on project core: Could not resolve dependencies for project test:core:jar:2.0.1-SNAPSHOT: The repository system is offline but the artifact lib-net:lib-net:jar:1.0.8 is not available in the local repository.

I tried to delete my local repository and install everything again, but it doesn't solve my problem!

Any sugestions?

Answer

Shashi Ranjan picture Shashi Ranjan · Sep 5, 2017

The problem is with maven version. I had the same issue on my Jenkins machine. I followed these steps and it resolved my issue:

  1. Delete the specific older libraries in ~/.m2/
  2. Change the version of maven to apache-maven-3.5.0
  3. Re-run the maven goals