spring依赖项管理gradle插件和artifactory
我正在尝试使用一个私有的人工制品gradle repo启动并运行一个新项目。我能够通过artifactory解决工件,但当我尝试将spring io和boot加入到组合中时,spring依赖关系管理插件在请求依赖关系时似乎没有添加版本,导致构建失败:spring依赖项管理gradle插件和artifactory,gradle,spring-boot,artifactory,spring-io,Gradle,Spring Boot,Artifactory,Spring Io,我正在尝试使用一个私有的人工制品gradle repo启动并运行一个新项目。我能够通过artifactory解决工件,但当我尝试将spring io和boot加入到组合中时,spring依赖关系管理插件在请求依赖关系时似乎没有添加版本,导致构建失败: FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':comp
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-data-rest:.
Searched in the following locations:
https://my-website.com/artifactory/gradle-release/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.pom
https://my-website.com/artifactory/gradle-release/org/springframework/boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.jar
https://my-website.com/artifactory/gradle-release/org.springframework.boot/spring-boot-starter-data-rest/ivy-.xml
https://my-website.com/artifactory/gradle-release/org.springframework.boot/spring-boot-starter-data-rest//spring-boot-starter-data-rest-.jar
我可以在上看到这些文件,但看起来“1.5.3.RELEASE”没有指向URL路径或文件名
我猜我的问题出在我的构建脚本中-有人能帮我确定这个问题吗
build.gradle:
plugins {
id 'java'
id 'io.spring.dependency-management' version '1.0.3.RELEASE'
id 'org.springframework.boot' version '1.5.3.RELEASE'
id 'com.jfrog.artifactory' version '4.4.18'
}
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:Brussels-SR2'
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'gradle-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
resolve {
repository {
repoKey = 'gradle-release'
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-data-rest'
compile 'org.springframework.boot:spring-boot-starter-hateoas'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.apache.commons:commons-lang3'
testCompile'org.springframework.boot:spring-boot-starter-test'
testCompile'org.springframework.restdocs:spring-restdocs-mockmvc'
}
找到了答案-看起来我的构建脚本没有问题-这是我的人工安全设置 为了通过artifactory解决依赖关系,需要为远程存储库启用deploy/cache(我认为这是不必要的,因为我不打算将任何东西部署到mavencentral);Artifactory试图缓存我为spring添加的新依赖项,这导致构建失败)。资料来源: 希望这对其他人有帮助,我已经在这上面浪费了足够多的时间:)