首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven -无法解析工件- cglib:cglib-nodep:jar:null

Maven -无法解析工件- cglib:cglib-nodep:jar:null
EN

Stack Overflow用户
提问于 2011-05-22 20:17:56
回答 3查看 7.3K关注 0票数 2

我正在尝试构建一个大型项目,但失败了,出现了以下错误:

代码语言:javascript
复制
[INFO] ------------------------------------------------------------------------
[INFO] Building Utilities
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1255 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 16 resources
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Couldn't find a version in [2.2.2] to match range [2.1_3,2.1_3]
  cglib:cglib-nodep:jar:null

from the specified remote repositories:
  java.net (http://download.java.net/maven/2),
  internal (http://repo.some-project.org/maven),
  central (http://repo1.maven.org/maven2)

Path to dependency:
        1) org.some-project:util:jar:1.5.0

I found并下载了cglib-nodep-2.1_3.jar

由于我缺乏使用maven的经验,我不确定如何(hrr...)让构建过程使用这个文件,而不是(我猜)从互联网上获取它时失败。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-05-22 20:50:11

cglib版本2.1_3已从主maven存储库中删除,以支持2.2.2版本

尝试将您的依赖项更新到2.2.2 -谁知道呢,也许它会起作用:)

如果没有,请下载2.1_3 (例如从here下载)并在本地使用manually install

票数 1
EN

Stack Overflow用户

发布于 2012-11-22 17:57:05

如果你把它放在dependencyManagement部分,而不是放在dependencies部分,它是有效的。

代码语言:javascript
复制
<dependencyManagement>
   <dependencies>
      <dependency>     
        <groupId>cglib</groupId>     
        <artifactId>cglib-nodep</artifactId>     
        <version>2.1_2</version> 
      </dependency>     
   </dependencies>
</dependencyManagement>

所有版本都正常工作。当我把它放在dependencies部分而不是dependencyManagement部分时,我得到了同样的错误。您不需要手动执行此操作。

票数 5
EN

Stack Overflow用户

发布于 2011-05-22 20:22:04

dependencyManagement部分下的pom.xml中,添加:

代码语言:javascript
复制
<project>
 ...
 <dependencyManagement>
  <dependencies>
  ...
   <dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>2.1_3</version>
    </dependency>
  ....
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6087862

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档