首页 文章

Gradle和本地Ivy存储库没有找到传递依赖

提问于
浏览
0

我正在构建一个Spring Boot Web应用程序,在我的设置中,我有一个托管所有第三方JAR的本地存储库 - 存储库是常 Spring 藤格式 . 我已经能够在连接到Maven Central存储库的同时构建WAR文件,现在我需要能够从本地存储库进行脱机构建 .

我已将所有必需的依赖项复制到常 Spring 藤格式( /{module}/{name}/{version}/{name}-{version}.jar )中,现在我想关闭 mavenCentral() 存储库并在本地构建 .

但是,如果我运行gradle依赖项,我没有看到列出的任何传递依赖项,就像我连接到maven central时那样 . 在我的本地仓库中,我还添加了相应的.pom文件(遵循与JAR文件相同的命名约定),并尝试添加ivy.xml文件,但仍然没有传递依赖项的迹象 .

任何人都可以指出我正确的方向或建议我在这里做错了什么?

我本地仓库中的一个Spring-Boot JAR的示例:

$ ls /repo/org.springframework.boot/spring-boot-starter-web/1.1.8.RELEASE
spring-boot-starter-web-1.1.8.RELEASE.jar  spring-boot-starter-web-1.1.8.RELEASE.pom

我的构建文件配置本地常 Spring 藤repo:

repositories {
    ivy   { url "file://repo" }
}

运行gradle依赖项的示例:

+--- org.springframework.boot:spring-boot-starter-web: -> 1.1.8.RELEASE
+--- org.springframework.boot:spring-boot-starter-security: -> 1.1.8.RELEASE
+--- org.springframework.boot:spring-boot-starter-thymeleaf: -> 1.1.8.RELEASE
+--- org.springframework:spring-context-support: -> 4.0.7.RELEASE

1 回答

  • 1

    如果你're not getting transitive dependencies then it probably can' t找到元数据描述符(ivy.xml) . 您可能必须指定自定义布局 . 有关详细信息,请查看here .

相关问题