首页 > 解决方案 > 在 gradle 中,没有 pom 文件的 maven 工件从 jcenter 工作,但不是 mavenCentral

问题描述

我有一个使用 gradle 的 Java 项目,它使用了一些非常古老的依赖项。其中一个具有传递依赖,可以正常工作,jcenter()但当我尝试迁移到mavenCentral(). 该工件存在于 Maven Central 中,但没有 pom 文件。Gradle 给了我这样的错误:

> Could not resolve all files for configuration ':myproject:compileClasspath'.
   > Could not find woodstox:wstx-asl:3.2.7.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/woodstox/wstx-asl/3.2.7/wstx-asl-3.2.7.pom

我浏览 jcenter 存储库的任何尝试都会返回 403 Forbidden,因此我无法判断 pom 文件是否存在,但 Gradle 能够以某种方式使用jcenter().

这给我留下了几个问题:

  1. (非常旧的)maven 工件是否需要 pom 文件?
  2. gradle 如何访问https://jcenter.bintray.com/
  3. 有什么方法可以查出 jcenter 工件是否有 pom 文件?
  4. 如果它没有 pom 文件,为什么 gradle 可以使用jcenter()但失败mavenCentral

提前感谢您的帮助!

标签: mavengradlejcenter

解决方案


推荐阅读