简体   繁体   中英

Can't reach maven dependency

Sometimes maven doesn't reach some dependency.

Surely by my fault, but I can build lots of projects, without problems with many many dependencies...

In this occasion I'm trying to get:

<dependency>
    <groupId>org.richfaces.cdk</groupId>
    <artifactId>maven-cdk-plugin</artifactId>
    <version>4.3.1.Final</version>
</dependency>

and I get:

[ERROR] Plugin org.richfaces.cdk:maven-cdk-plugin:4.3.1.Final or one of its depe
ndencies could not be resolved: Could not find artifact org.richfaces.cdk:maven-
cdk-plugin:jar:4.3.1.Final in central (https://repo.maven.apache.org/maven2) ->
[Help 1]

I'm currently using maven 3.3.9 with jdk 1.8. I've also added a repository tag in my active profile referece in the settings.xml:

...
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles> 
  <profiles>

...
   <profile>
      <id>nexus</id>
      <!--Override the repository (and pluginRepository) "central" from the Maven Super POM
          to activate snapshots for both! -->
      <repositories> 
 <repository>
          <id>repoId022</id>
          <name>repositoryId022</name> 
          <url>https://mvnrepository.com/artifact/</url>
        </repository>
...

I've checked in my browser and I can reach the dependency path and download it without problems.

Now I'm out of ideas...can u suggest anything? ThankS!

Issue was that the maven central repository which hosts all the artifacts was missing the artifact which you mentioned in your pom.xml.

Error message was clear that maven was not able to resolve the dependencies, causes of which is normally when you specify the wrong artifact name or version.

What i did is just verified it on maven central repo.

You can search your artifact by following the base url https://repo.maven.apache.org/maven2/ and then search with the group and artifact id. i found that artifact name is changed from maven-cdk-plugin to maven-richfaces-resources-plugin And below is the URL for same. https://repo.maven.apache.org/maven2/org/richfaces/cdk/maven-richfaces-resources-plugin/4.3.1.Final/

Hope its clear to you and let me know if you have other queries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM