-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
135 lines (119 loc) · 4.07 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
buildscript {
repositories {
mavenLocal()
maven {
url MAVEN_REPOSITORY_ALIYUN
}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.1.7.RELEASE'
}
}
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
}
configurations.all {
// 动态版本
resolutionStrategy.cacheDynamicVersionsFor 24, 'hours'
// 变化模块
resolutionStrategy.cacheChangingModulesFor 30, 'minutes'
}
allprojects {
group 'com.xjbg'
version '1.0-SNAPSHOT'
}
def versionMap = [
"springCloudVersion": "2021.0.7",
"springboot" : "2.7.12",
"springCloudNacos" : "2.2.2.RELEASE"
]
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
repositories {
mavenLocal()
maven {
url MAVEN_REPOSITORY_ALIYUN
}
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
publishing {
repositories {
mavenLocal()
maven {
credentials {
username MAVEN_REPOSITORY_USER
password MAVEN_REPOSITORY_PWD
}
url MAVEN_REPOSITORYT_URL
}
}
publications {
maven(MavenPublication) {
pom {
packaging 'jar'
}
groupId project.group
artifactId project.name
version project.version
from components.java
artifact sourcesJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
}
dependencyManagement {
dependencies {
dependency 'org.projectlombok:lombok:1.18.30'
dependency 'com.alibaba:fastjson:1.2.83'
dependency group: 'junit', name: 'junit', version: '4.13'
dependency 'commons-beanutils:commons-beanutils:1.9.4'
dependency 'commons-codec:commons-codec:1.15'
dependency 'org.apache.commons:commons-lang3:3.11'
dependency 'commons-collections:commons-collections:3.2.2'
dependency 'commons-io:commons-io:2.8.0'
dependency 'commons-fileupload:commons-fileupload:1.4'
dependency "com.squareup.okhttp3:okhttp:3.14.9"
dependency "com.google.guava:guava:29.0-jre"
dependency "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:$versionMap.springCloudNacos"
dependency "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:$versionMap.springCloudNacos"
}
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:$versionMap.springboot"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$versionMap.springCloudVersion"
mavenBom 'com.amazonaws:aws-java-sdk-bom:1.11.908'
}
}
dependencies {
implementation 'com.alibaba:fastjson'
implementation 'commons-io:commons-io'
implementation 'org.apache.commons:commons-lang3'
implementation 'commons-fileupload:commons-fileupload'
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testImplementation group: 'junit', name: 'junit'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
}