Maven无法扫描依赖

发布于 2025-01-22 16:24:51 字数 767 浏览 2 评论 0原文

我在我的POM中添加了一个依赖性:

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik-all</artifactId>
    <version>1.14</version>
</dependency>

富含任何问题毫无疑问,但是在启动期间,有多个问题,可以分为两组:

  • 由:java.nio.file.file.nosuchfileexception:d :.m2 \ repository \ org \ apache \ xmlgraphics \ batik-ttf2svg \ 1.14 \ lib \ batik-ttf2svg-1.14.jar

    真实路径中没有“ lib”文件夹

  • 无法扫描[file:/d:/。m2/repository/org/apache/xmlgraphics/batik-ttf2svg/1.14/lib/lib/batik-constants-1.14.jar]

    应用程序试图扫描与文物文件夹的不同罐子。我的猜测是,这种“错误的”工件是一种依赖性,它在错误的文件夹中查找。

我尝试直接将依赖性注入聚合jar,但总体而言,错误是相同的。整个项目的设置非常复杂,可能会有一些配置使它搞砸了,但是我找不到。

它背后的原因是什么,可以解决什么?

谢谢!

I have a dependency added as an aggregate into my pom:

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik-all</artifactId>
    <version>1.14</version>
</dependency>

Complilation runs fine without any issues, but during startup there are multiple issues, which can be grouped into two groups:

  • Caused by: java.nio.file.NoSuchFileException: D:.m2\repository\org\apache\xmlgraphics\batik-ttf2svg\1.14\lib\batik-ttf2svg-1.14.jar

    There is no 'lib' folder in the real path

  • Failed to scan [file:/D:/.m2/repository/org/apache/xmlgraphics/batik-ttf2svg/1.14/lib/batik-constants-1.14.jar] from classloader hierarchy (main)

    App tries to scan a different jar from the artifact folder. My guess is that this 'wrong' artifact is a dependency, which is looked up in the incorrect folder.

I tried injecting dependencies directly with aggregate jar, but overall the errors are the same. The whole project setup is quite complicated, there might be some configuration that messes this up, but I cannot find it.

What can be the reason behind it and what is the possible fix?

Thanks!

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

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

发布评论

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

评论(1

柒夜笙歌凉 2025-01-29 16:24:51
  1. 此路径可能会在您的项目中进行硬编码,查找并删除
D:.m2\repository\org\apache\xmlgraphics\batik-ttf2svg\1.14\lib\batik-ttf2svg-1.14.jar
  1. 尝试重命名或删除XMLGraphics文件夹,因此Maven可以再次下载依赖项,然后清洁并构建您的项目
 mvn clean install
  1. This path could be hard coded in your project, find and remove
D:.m2\repository\org\apache\xmlgraphics\batik-ttf2svg\1.14\lib\batik-ttf2svg-1.14.jar
  1. try to rename or delete xmlgraphics folder so than maven can download the dependencies once again, then clean and build your project
 mvn clean install
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文