-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (110 loc) · 4.23 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins{
id 'java'
id 'org.springframework.boot'
id 'maven-publish'
id "org.flywaydb.flyway"
}
//spring boot cloud and alibaba cloud version wiki:https://github.com/alibaba/spring-cloud-alibaba/wiki
ext{
set("springCloudVersion", "2021.0.1")
set("alibabaCloudVersion", "2021.0.1.0")
set("springDataR2DBCVersion", "Borca-RELEASE")
set("dubboVersion", "3.0.5")
}
allprojects{
group = 'com.cheeseocean'
version = '1.0.0'
repositories {
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/public' }
mavenLocal()
maven {
url = uri("https://maven.pkg.github.com/cheeseocean/CheesePackages")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'maven-publish'
apply plugin: 'org.flywaydb.flyway'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testImplementation 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation platform("org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}")
implementation platform(SpringBootPlugin.BOM_COORDINATES)
implementation platform("com.alibaba.cloud:spring-cloud-alibaba-dependencies:${alibabaCloudVersion}")
implementation platform("org.apache.dubbo:dubbo-dependencies-bom:${dubboVersion}")
implementation platform("io.r2dbc:r2dbc-bom:${springDataR2DBCVersion}")
//Spring Session
implementation 'org.springframework.session:spring-session-data-redis'
implementation 'io.lettuce:lettuce-core'
//Alibaba Nacos
implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
//Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
}
task apiJar (type: Jar){
from(sourceSets.main.output){
include 'com/cheeseocean/*/api/**'
}
}
task apiSourceJar(type: Jar){
from(sourceSets.main.allSource){
include 'com/cheeseocean/*/api/**'
}
archiveClassifier = 'sources'
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/cheeseocean/CheesePackages")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
artifactId "${project.name}-api"
//using gradle module:publish -Dapi.version or edit in gradle.properties
version System.getProperty("api.version") ?: project.findProperty("${project.name}.api.version")
artifact apiJar
artifact apiSourceJar
pom {
name = "${project.name} API Jar"
description = "CheeseMilk API dependencies"
url = "http://github.com/cheeseocean/CheeseMilk"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "xxxcrel"
name = "xxxcrel"
email = "crelxc@gmail.com"
}
}
}
}
}
}
test {
useJUnitPlatform()
}
bootJar {
archiveFileName = "${project.name}.jar"
}
}