How to resolve outdated repository informations in a pom?

I have a legacy application that I'm trying to build using maven 2.

The build currently fails with the message

Unable to get dependency information: Unable to read the metadata file for artifact 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar': Cannot find parent: org.sonatype.oss:oss-parent for project: com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2 for project com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2
  com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

The application has a dependency on concurrentlinkedhashmap 1.2. However this artifact specifies the following in its pom.xml:

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>3</version>
  </parent>
  ...
  <repositories>
    <repository>
      <id>sourceforge</id>
      <url>http://oss.sonatype.org/content/groups/sourceforge/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    ...
  </repositories>

Now when looking at the specified repository, the dependency isn't contained in there.

However the parent dependency is available in maven central.

What do I need to do, that the dependency gets downloaded from maven central instead?

1 answer

  • answered 2018-03-14 10:36 SpaceTrucker

    If the artifact is now contained in another repo, a mirror can be defined in the maven settings to point maven to the repo that now contains the artificat.

    <mirror>
      <id>sourceforge-mirror</id>
      <name>Sourceforge Mirror</name>
      <url>http://repo1.maven.org/maven2</url>
      <mirrorOf>sourceforge</mirrorOf>
    </mirror>
    

    However this won't work if the source of the mirror contains some artifacts, that the target of the mirror doesn't.