[Gradle]一个版本错误实例(Could not find xxx)

build.gradle配置, 由于spring用的包比较多, 统一配置了版本号, 如下:

ext{
    springVersion = '4.3.13.RELEASE'
}

dependencies {

    compile group: 'org.springframework', name: 'spring-webmvc', version: springVersion
    compile group: 'org.springframework', name: 'spring-jdbc', version: springVersion
    compile group: 'org.springframework', name: 'spring-web', version: springVersion

//...
    compile group: 'org.apache.tomcat', name: 'tomcat-servlet-api', version: springVersion

}

编译时出现错误:

Warning:<i><b>root project 'Mattrack': Web Facets/Artifacts will not be configured properly</b>
Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':runtimeClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.apache.tomcat:tomcat-servlet-api:4.3.13.RELEASE.
Required by:
    project :</i>

注意此处: Could not find org.apache.tomcat:tomcat-servlet-api:4.3.13.RELEASE.
  意思是找不到"org.apache.tomcat:tomcat-servlet-api:4.3.13.RELEASE"
查看build.gradle, 发现'tomcat-servlet-api'错误的使用了Spring的版本号.

猜你喜欢

转载自my.oschina.net/u/344631/blog/1617965
今日推荐