我正在从Maven3迁移到Gradle,我在这种形式下对Spring有一个传递依赖:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${supported-spring-version}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我无法更改依赖项的pom.xml,那么如何解决这种传递依赖?这里有两个问题.
小智 0
有关详细信息,请查看:http://gradle.org/docs/current/userguide/artifact_dependency_tutorial.html
在gradle中声明依赖的语法如下:
dependencies {
compile group: 'org.springframework', name: 'spring-jdbc', version: '${supported-spring-version}'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
Run Code Online (Sandbox Code Playgroud)
要设置supported-spring-version属性,您可以使用本教程中所述的config.groovy文件: http: //mrhaki.blogspot.com/2009/11/gradle-goodness-using-properties-for.html
| 归档时间: |
|
| 查看次数: |
3321 次 |
| 最近记录: |