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

发布于 2024-11-08 23:21:00 字数 1212 浏览 2 评论 0原文

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

[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 找到并下载cglib-nodep-2.1_3.jar
由于我缺乏使用 Maven 的经验,我不确定如何(hrr...)使构建过程使用此文件,而不是(我猜)从互联网获取它失败。

I'm trying to build a large project and failing with the following error:

[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 and downloaded cglib-nodep-2.1_3.jar
As I lack experience with maven, I'm not sure how to (hrr...) make the build process use this file instead of failing on (I guess) fetching it from the internet.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

或十年 2024-11-15 23:21:00

如果您将其放入 dependencyManagement 部分,而不是将其放入 dependencies 部分,则它可以正常工作。

<dependencyManagement>
   <dependencies>
      <dependency>     
        <groupId>cglib</groupId>     
        <artifactId>cglib-nodep</artifactId>     
        <version>2.1_2</version> 
      </dependency>     
   </dependencies>
</dependencyManagement>

所有版本都可以工作。当我将其放入 dependencies 部分而不是 dependencyManagement 部分时,我遇到了同样的错误。你不需要这样做
手动。

It is working if you put in the dependencyManagement section, instead of putting it in the dependencies section.

<dependencyManagement>
   <dependencies>
      <dependency>     
        <groupId>cglib</groupId>     
        <artifactId>cglib-nodep</artifactId>     
        <version>2.1_2</version> 
      </dependency>     
   </dependencies>
</dependencyManagement>

All the versions are working. I was getting the same error when I had put it in the dependencies section instead of dependencyManagement section. You need not do it
manually.

初心 2024-11-15 23:21:00

在 pom.xml 的 dependencyManagement 部分下添加:

<project>
 ...
 <dependencyManagement>
  <dependencies>
  ...
   <dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>2.1_3</version>
    </dependency>
  ....

In your pom.xml under the dependencyManagement section add:

<project>
 ...
 <dependencyManagement>
  <dependencies>
  ...
   <dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>2.1_3</version>
    </dependency>
  ....
唱一曲作罢 2024-11-15 23:21:00

cglib 版本 2.1_3 已从主 Maven 存储库中删除,取而代之的是 2.2.2
尝试将您的依赖项更新到 2.2.2 - 谁知道呢,也许它会起作用:)
如果没有,请下载 2.1_3(从 此处< /a> 例如)和 手动在本地安装

cglib version 2.1_3 has been removed from the main maven repo in favor of 2.2.2
Try updating your dependency to 2.2.2 - who knows, perhaps it'll work :)
If it doesn't, download 2.1_3 (from here for example) and manually install it locally.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文