6

I am trying to build a project after long time and I am getting the following error.

Failed to execute goal on project The following artifacts could not be resolved:

org.restlet.jee:org.restlet:jar:2.1.7,

org.restlet.jee:org.restlet.ext.servlet:jar:2.1.7,

org.restlet.jee:org.restlet.ext.spring:jar:2.1.7,

org.restlet.jee:org.restlet.ext.freemarker:jar:2.1.7,

org.restlet.jee:org.restlet.ext.xml:jar:2.1.7:

Failure to find org.restlet.jee:org.restlet:jar:2.1.7

in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

My pom.xml has the following dependency

<dependency>
  <groupId>org.restlet.jee</groupId>
  <artifactId>org.restlet.ext.servlet</artifactId>
  <version>${org.restlet.version}</version>
</dependency>

The repo is defined in following way:

   <repository>
        <id>central</id>
        <name>Maven Plugin Repositoty</name>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
Potney Switters
  • 2,902
  • 4
  • 33
  • 51

2 Answers2

10

To figure out where to look for dependencies, one usually just starts with the site mvnrepository.com. This site not only helps you figure out the proper groupId, artifactId and version to use, but also indicates where exactly to find the artifact you need as not all artifacts are in Maven central.

In this case the site will tell you they are in a repository maven.restlet.org, if you follow that url in a browser you will see this is indeed true. As such, you need that repository in your pom or settings.xml before the artifacts can be found.

<repositories>
  <repository>
    <id>maven.restlet.org</id>
    <name>maven.restlet.org</name>
    <url>http://maven.restlet.org</url>
  </repository>        
</repositories>    

That will do it.

Gimby
  • 5,095
  • 2
  • 35
  • 47
  • 1
    As of 2023, `https://maven.restlet.org` fails but browsing it leads to a replacement at `https://maven.restlet.talend.com` which does seem to resolve properly. – Peteris Jun 07 '23 at 15:59
  • Actually mvnrepository.org seems to now indicate that it is to be found in the spring plugins repository at https://repo.spring.io/plugins-release/ . This does not seem to be actually true though :/ – Gimby Jun 08 '23 at 08:53
1

First make sure that those artifacts are available in Maven Central.

Then delete the org/restlet/jee folder from your local .m2 repository and re-import. If those JARs are available in Maven Central they will be downloaded again to your local .m2.

Here's where you can find org.restlet.jee in Maven Central.

If you are still having problems you have to make a choice:

  1. Find another repo that has what you need.
  2. Go to the restlet page, download the JARs manually, and add them to your local .m2.
  3. Stop using that library and find an alternative.
Zoe
  • 27,060
  • 21
  • 118
  • 148
duffymo
  • 305,152
  • 44
  • 369
  • 561
  • I did what you suggested. I can find the 2.1.7 in the repository. I am still getting the same error. – Potney Switters Dec 23 '16 at 10:06
  • I have even changed version to 2.0.0 but I still get The POM for org.restlet.jee:org.restlet.ext.servlet:jar:2.2.0 is missing, no dependency information available Downloading: http://repo1.maven.org/maven2/org/restlet/jee/org.restlet.ext.spring/2.2.0/org.restlet.ext.spring-2.2.0.pom However you can see that the artifact is there https://maven-repository.com/artifact/org.restlet.jee/org.restlet/2.2.0 I am a bit confused – Potney Switters Dec 23 '16 at 10:09
  • 2
    `org.restlet` does not exist in Maven Central. – khmarbaise Dec 23 '16 at 10:12
  • Now I understand. https://maven-repository.com/artifact/org.restlet.jee/org.restlet/2.1.7 I followed the same procedure after adding opencast-public http://nexus.virtuos.uos.de/nexus/content/repositories/public//nexus/content/repositories/public/ Still get the same error – Potney Switters Dec 23 '16 at 10:18
  • @duffymo is there anything else I can do? – Potney Switters Dec 23 '16 at 12:01
  • 1
    @duffymo mvnrepository also shows artifacts of non-central repositories. In this case the org.restlet.jee packages are in the http://maven.restlet.org/ repository, so indeed khmarbaise is correct. – Gimby Dec 23 '16 at 12:59