据我所知,gradle在设置依赖项时需要版本号,但允许使用部分通配符.例如,如果我想要番石榴,我不能这样做,因为它失败了:
compile('com.google.guava:guava')
Run Code Online (Sandbox Code Playgroud)
它必须(作为一个例子):
compile('com.google.guava:guava:21.0')
Run Code Online (Sandbox Code Playgroud)
但是,我正在学习Spring,它有以下几点:
compile("org.springframework.boot:spring-boot-starter")
compile("org.springframework:spring-web")
compile("com.fasterxml.jackson.core:jackson-databind")
Run Code Online (Sandbox Code Playgroud)
这些依赖项如何在没有提供版本的情况下工作?
是因为以下内容,但我认为只有我的插件'org.springframework.boot'需要这些行:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE")
}
}
Run Code Online (Sandbox Code Playgroud) gradle ×1