0

My working local setup has broken all of a sudden. So, I tried restoring the local repository with a backup. I am doing the following from Intellij (which has a configuration to overwrite default maven settings.xml file) -

mvn install -Denv=live -Dmaven.test.skip=true

This fails for some recently added dependencies, because those are not available in the private repository (configured in settings_overwrite.xml).

So, from command line (using default settings.xml), I run the same command, but I get some other error -

Downloading from some-private-repo: https://repository-someprivate.forge.cloudbees.com/private/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from repository.springsource.milestone: http://repo.springsource.org/milestone/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from bitwalker.user-agent-utils.mvn.repo: https://raw.github.com/HaraldWalker/user-agent-utils/mvn-repo/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from fdvsolution.public: http://archiva.fdvs.com.ar/repository/public1/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from spring-snapshots: http://repo.spring.io/snapshot/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from spring-milestones: http://repo.spring.io/milestone/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom
Downloading from central: https://repo.maven.apache.org/maven2/red/bcprov-jdk/16.144/bcprov-jdk-16.144.pom

..

[ERROR] Failed to execute goal on project some-common-user-management: Could not resolve dependencies for project com.someproject:some-common-user-management:jar:1.0.1-SNAPSHOT: Failed to collect dependencies at com.someproject:some-common:jar:1.0.1-SNAPSHOT -> red:bcprov-jdk:jar:16.144: Failed to read artifact descriptor for red:bcprov-jdk:jar:16.144: Could not transfer artifact red:bcprov-jdk:pom:16.144 from/to some-private-repo (https://repository-some.forge.cloudbees.com/private/): repository-some.forge.cloudbees.com: unknown error: Unknown host repository-some.forge.cloudbees.com: unknown error -> [Help 1]

These repositories are defined in one of the pom files.

I can see it contains the following -

SandeepanNath:16.144 sandeepan.nath$ pwd

~/.m2/repository/red/bcprov-jdk/16.144/

SandeepanNath:16.144 sandeepan.nath$ ls -lrth
total 3360
-rw-r--r--  1 sandeepan.nath  1974079253    40B Jun  5 15:58 bcprov-jdk-16.144.pom.sha1
-rw-r--r--  1 sandeepan.nath  1974079253   458B Jun  5 15:58 bcprov-jdk-16.144.pom
-rw-r--r--  1 sandeepan.nath  1974079253   1.6M Jun  5 15:58 bcprov-jdk-16.144.jar
-rw-r--r--  1 sandeepan.nath  1974079253    40B Jun  5 15:58 bcprov-jdk-16.144.jar.sha1
-rw-r--r--  1 sandeepan.nath  1974079253   195B Jun  5 15:58 _remote.repositories
-rw-r--r--  1 sandeepan.nath  1974079253   1.9K Jun  5 16:15 bcprov-jdk-16.144.pom.lastUpdated

I am not sure why the remote repository lookup is happening still. How do I resolve this causing the build failure issue.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
  • Network: `Unknown host repository-some.forge.cloudbees.com: unknown error` not using a repository manager? – khmarbaise Jun 05 '20 at 12:41
  • It seems this is a managed repository. However, my doubt is why is it even looking for this, when the local repository has it. – Sandeepan Nath Jun 05 '20 at 12:55
  • Maybe related to [this question](https://stackoverflow.com/questions/49682961/how-to-avoid-bcprov-jdk16-1-45-jar-while-running-the-application-through-pom-ent) check your classpath for multiple versions of bcprov – Dirk Deyne Jun 05 '20 at 14:11
  • This resolved my issue - https://stackoverflow.com/a/21469264/351903 – Sandeepan Nath Jun 05 '20 at 15:20

1 Answers1

0

If you are sure your jar/pom files are ok, just remove *.lastUpdated marker. This file indicates to Maven that it attempted to obtain the archive by download, but was unsuccessful.

> rm bcprov-jdk-16.144.pom.lastUpdated

Also make sure maven is really using ~/.m2/repository as your local repo. Check with:

> mvn help:evaluate -Dexpression=settings.localRepository
ursa
  • 4,404
  • 1
  • 24
  • 38