forked from gradle/gradle
/
build.gradle
49 lines (44 loc) · 1.33 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
repositories {
mavenCentral()
}
configurations {
implementation
runtimeOnly
}
// tag::define-dependency[]
dependencies {
implementation 'org.hibernate:hibernate-core:3.6.7.Final'
}
// end::define-dependency[]
// tag::use-configuration[]
tasks.register('listJars') {
FileCollection implementation = configurations.implementation
doLast {
implementation.each { File file -> println file.name }
}
}
// end::use-configuration[]
// tag::module-dependencies[]
dependencies {
runtimeOnly group: 'org.springframework', name: 'spring-core', version: '2.5'
runtimeOnly 'org.springframework:spring-core:2.5',
'org.springframework:spring-aop:2.5'
runtimeOnly(
[group: 'org.springframework', name: 'spring-core', version: '2.5'],
[group: 'org.springframework', name: 'spring-aop', version: '2.5']
)
runtimeOnly('org.hibernate:hibernate:3.0.5') {
transitive = true
}
runtimeOnly group: 'org.hibernate', name: 'hibernate', version: '3.0.5', transitive: true
runtimeOnly(group: 'org.hibernate', name: 'hibernate', version: '3.0.5') {
transitive = true
}
}
// end::module-dependencies[]
// tag::file-dependencies[]
dependencies {
runtimeOnly files('libs/a.jar', 'libs/b.jar')
runtimeOnly fileTree('libs') { include '*.jar' }
}
// end::file-dependencies[]