Maven 的意思是:“无法检索依赖项的目标文件名”

发布于 2024-09-11 06:30:57 字数 509 浏览 13 评论 0原文

我在构建 WAR 时一直在 Google 上搜索以下警告,但找不到解释:

[WARNING] Could not retrieve the target file name of dependency [Dependency {groupId=org.company.xml.jaxbtypes, artifactId=iJaxbtypes, version=1.0.2-SNAPSHOT, type=jar}]

依赖关系已解决并且一切按预期工作,但 WEB-INF/lib 包含:

  • iJaxbtypes-1.0.2-20100721.170712-1

如果我不要运行干净,我现在有:

  • iJaxbtypes-1.0.2-20100721.170712-1
  • iJaxbtypes-1.0.2-20100721.170712-6

这是因为它是 SNAPSHOT 依赖项吗?我已经使用 Maven 好几年了,但还没有遇到过这个。

I have been Googling for the following warning when building a WAR, but can't find an explanation:

[WARNING] Could not retrieve the target file name of dependency [Dependency {groupId=org.company.xml.jaxbtypes, artifactId=iJaxbtypes, version=1.0.2-SNAPSHOT, type=jar}]

The dependency is resolved and everything works as expected, but WEB-INF/lib contains:

  • iJaxbtypes-1.0.2-20100721.170712-1

If I don't run a clean, I now have:

  • iJaxbtypes-1.0.2-20100721.170712-1
  • iJaxbtypes-1.0.2-20100721.170712-6

Is this because it's a SNAPSHOT dependency? I've been using Maven for a couple of years now, but hadn't come across this one.

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

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

发布评论

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

评论(1

红墙和绿瓦 2024-09-18 06:30:57

使用 SNAPSHOT 依赖项时,Maven 将在远程存储库中查找 groupId/artifactId/version/maven-metadata.xml,通常如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.sonatype.nexus</groupId>
  <artifactId>nexus</artifactId>
  <version>1.4.2-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20091214.221414</timestamp>
      <buildNumber>13</buildNumber>
    </snapshot>
    <lastUpdated>20091214221558</lastUpdated>
  </versioning>
</metadata>

Maven 使用此文件来了解最新的快照工件文件是。

我相信您没有 iJaxbtypes 工件的元数据,或者它们已损坏,并且 Maven 无法正确处理快照并每次下载最新文件而不重命名它。

检查远程存储库中的 maven-metadata.xml 以及部署过程。如果一切看起来都很好,请尝试从本地存储库中删除合并的元数据。

另请参见

When using a SNAPSHOT dependency, Maven will look in the remote repository for a groupId/artifactId/version/maven-metadata.xml which typically looks like:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.sonatype.nexus</groupId>
  <artifactId>nexus</artifactId>
  <version>1.4.2-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20091214.221414</timestamp>
      <buildNumber>13</buildNumber>
    </snapshot>
    <lastUpdated>20091214221558</lastUpdated>
  </versioning>
</metadata>

This file used by Maven to understand what the latest snapshot artifact file is.

I believe that you don't have metadata for your iJaxbtypes artifact, or they are corrupted, and Maven can't handle the SNAPSHOT properly and download the latest file each time without renaming it.

Check the remote repository for the maven-metadata.xml and maybe also the deployment procedure. If everything looks fine, try to remove the merged metadata from your local repository.

See also

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