user2071938
user2071938

Reputation: 2265

MVN install, cannot find artifact in local repository

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?

Upvotes: 3

Views: 11317

Answers (2)

Shashi Ranjan
Shashi Ranjan

Reputation: 1561

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

Upvotes: 1

degr
degr

Reputation: 1565

Think I know way how to do it properly

  1. Download sources of your library locally
  2. Go to ~/.m2/ and search for your lib
  3. Delete it from here
  4. perform "mvn clean install" for your library
  5. search for your lib in ~/.m2/
  6. try to "mvn clean install" on your main project
  7. ... ?
  8. Profit

If it will no work, check that you use correct artifact id and group id.

Upvotes: 1

Related Questions