-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (92 loc) · 3.2 KB
/
build.gradle.kts
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
plugins {
val sysProps = System.getProperties()
val lombokVersion: String by sysProps
val springBootVersion: String by sysProps
val dependencyManagement: String by sysProps
id("org.springframework.boot") version springBootVersion
id("io.spring.dependency-management") version dependencyManagement
id("io.freefair.lombok") version lombokVersion
java
`java-library`
`maven-publish`
}
allprojects {
apply {
plugin("java")
plugin("java-library")
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
plugin("io.freefair.lombok")
plugin("maven-publish")
plugin("idea")
}
java {
toolchain {
//languageVersion.set(JavaLanguageVersion.of("11")) // "8"
}
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
}
val repos = listOf("https://maven.aliyun.com/nexus/content/groups/public", "https://jcenter.bintray.com/")
repositories {
mavenLocal()
repos.forEach { maven(it) }
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks {
bootJar {
enabled = false
archiveClassifier.set("boot")
}
jar {
enabled = true
archiveClassifier.set("")
}
test {
failFast = true
useJUnitPlatform()
testLogging { showStandardStreams = true }
}
register("install") {
dependsOn("build", "publishToMavenLocal")
}
}
}
fun DependencyHandler.apiWithVersion(dependencyNotation: String) =
api(dependencyNotation + ":" + dependencyManagement.managedVersions[dependencyNotation])
project(":data-jpa") {
dependencies {
val entityGraphVersion = "2.6.0"
val versions = dependencyManagement.importedProperties
apiWithVersion("org.springframework.boot:spring-boot-starter-data-jpa")
apiWithVersion("com.querydsl:querydsl-jpa")
apiWithVersion("org.apache.commons:commons-lang3")
api("com.cosium.spring.data:spring-data-jpa-entity-graph:$entityGraphVersion")
annotationProcessor("com.querydsl:querydsl-apt:${versions["querydsl.version"]}:jpa")
annotationProcessor("javax.annotation:javax.annotation-api")
annotationProcessor("javax.persistence:javax.persistence-api")
annotationProcessor("org.hibernate:hibernate-jpamodelgen")
annotationProcessor("com.cosium.spring.data:spring-data-jpa-entity-graph-generator:$entityGraphVersion")
}
}
project(":data-jpa-test") {
dependencies {
apiWithVersion("org.springframework.boot:spring-boot-starter-data-jpa")
apiWithVersion("org.springframework.boot:spring-boot-starter-test")
apiWithVersion("com.h2database:h2")
apiWithVersion("mysql:mysql-connector-java")
api(project(":data-jpa"))
api("org.apache.ant:ant:1.10.12")
api("org.dbunit:dbunit:2.7.3")
api("com.google.guava:guava:31.0.1-jre")
}
}