2017-05-25 147 views
1

有时maven不会达到某些依赖关系。无法达到maven依赖关系

当然由我的错,但我可以建立很多的项目,没有很多很多依赖问题......

在此之际,我试图让:

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

和我:

[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] 

我目前使用maven 3.3.9使用JDK 1.8。我也是在settings.xml中添加一个标签库在我的活动轮廓referece:

... 
    <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> 
... 

我在我的浏览器检查,我能达到的依赖路径,并下载它没有问题。

现在我出来的想法...你可以建议任何事情吗? 谢谢!

+0

尝试下载依赖项,然后添加它maven或强制maven从本地文件获取 –

+0

@Mark,maven中央工件id从maven-cdk-plugin更改为maven-richfaces-resources-plugin,可以替换这并再试一次? –

+0

阿米特是对的。请更好地解释你如何指出,我将标记为正确的答案! –

回答

3

问题在于承载所有工件的maven中央存储库缺少您在pom.xml中提到的工件。

错误消息很明显,maven无法解决依赖关系,其原因通常是在您指定错误的工件名称或版本时。

我所做的只是在maven中央回购库上进行验证。

您可以按照基地址https://repo.maven.apache.org/maven2/搜索您的工件,然后使用组和工件ID进行搜索。我发现工件名称从maven-cdk-plugin更改为maven-richfaces-resources-plugin并且以下是相同的URL。 https://repo.maven.apache.org/maven2/org/richfaces/cdk/maven-richfaces-resources-plugin/4.3.1.Final/

希望它清楚给你,让我知道你是否有其他疑问。

+0

反正它在不同的回购:https://repository.jboss.org/nexus/content/repositories/releases/org/richfaces/cdk/maven-richfaces-resources -plugin/4.3.1.Final / –