我正在尝试从我的本地神器实例中删除依赖项。依赖项是我拥有的另一个项目(org.myproject),它有几个spring boot依赖项。
这是gradle故障:
FAILURE: Build failed with an exception
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.myproject.xxx:yyy:0.0.1-SNAPSHOT.
Required by:
:localproject:unspecified
> Could not resolve org.myproject.xxx:yyy:0.0.1-SNAPSHOT.
> Could not parse POM http://10.x.x.x:8081/artifactory/path/to/artifact.pom
> Unable to resolve version for dependency 'org.springframework.boot:spring-boot-starter-aop:jar'
当我运行gradlew依赖项时,它会在尝试确定所有项目的依赖项及其关联版本时失败。
我在周围搜索了一下,其他人在过去曾抱怨过这个问题,但他们相关的错误似乎已经解决了。我已经尝试了最新的gradle版本2.3 / 2.4,它仍然无法正常工作。
上传的org.myproject的artifactory插件生成的pom没有与spring-boot依赖项显式关联的任何版本
有没有人知道这里会发生什么?
编辑 - 为org.myproject添加我的build.gradle
buildscript {
ext {
springBootVersion = '1.2.4.RELEASE'
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath 'com.h2database:h2:1.3.170'
classpath 'org.flywaydb:flyway-gradle-plugin:3.2.1'
}
}
plugins {
id "com.jfrog.artifactory" version "3.1.1"
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: 'org.flywaydb.flyway'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
allprojects {
apply plugin: "com.jfrog.artifactory"
}
group = 'org.myproject.xxx'
version = '0.0.1-SNAPSHOT'
def publishRepoKey = 'libs-snapshot-local'
war {
baseName = "vsis-core"
version = "${version}"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
configurations {
providedRuntime
}
flyway {
url = 'jdbc:h2:file:target/defaultDB'
user = 'sa'
}
dependencies {
def jaxenVersion = '1.1.6'
compile "jaxen:jaxen:${jaxenVersion}"
def apacheCommonsMath3 = '3.4.1'
compile "org.apache.commons:commons-math3:${apacheCommonsMath3}"
compile "org.springframework.retry:spring-retry:1.1.2.RELEASE"
compile "org.springframework.boot:spring-boot-starter-aop"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-security"
compile "org.springframework.boot:spring-boot-starter-thymeleaf"
// dao libs
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile("org.hibernate:hibernate-ehcache")
compile("org.flywaydb:flyway-core")
def springSecurityVersion = '4.0.1.RELEASE'
compile "org.springframework.security:spring-security-core:${springSecurityVersion}"
compile "org.springframework.security:spring-security-web:${springSecurityVersion}"
compile "org.springframework.security:spring-security-config:${springSecurityVersion}"
compile "org.springframework.security:spring-security-taglibs:${springSecurityVersion}"
compile 'org.springframework.security.extensions:spring-security-saml2-core:1.0.1.RELEASE'
providedRuntime 'commons-io:commons-io:1.4'
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile 'org.mockito:mockito-all:1.9.5'
testCompile 'org.easymock:easymock:3.3.1'
testCompile("org.hsqldb:hsqldb")
}
compileJava {
options.compilerArgs << '-parameters'
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
downloadSources = true
downloadJavadoc = true
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
resolve {
repository {
repoKey = 'libs-release'
}
}
publish {
repository {
repoKey = "${publishRepoKey}"
username = "${artifactory_user}"
password = "${artifactory_password}"
}
defaults {
publications 'main'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}