-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (80 loc) · 2.29 KB
/
build.gradle
File metadata and controls
80 lines (80 loc) · 2.29 KB
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
description = 'Common Parent'
def jdkVersion = '12.0'
def adcFrameWorkVersion = '0.0.7-SNAPSHOT'
buildscript {
ext {
springBootVersion = '2.2.1.RELEASE'
commonsLang3 = '3.9'
junit5Version = '5.5.0'
lombok = '1.18.12'
googleCodeFindbugs = '3.0.1'
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
// 所有模块/项目的通用配置
allprojects {
group 'com.adotcode.framework'
version adcFrameWorkVersion
apply plugin: 'idea'
apply plugin: 'java'
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
//指定JDK版本
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
//指定编码格式
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
}
//子模块/项目的统一配置
subprojects {
apply plugin: 'maven-publish'
//jar 部署
publishing {
repositories {
maven {
name = "GitHub"
url = uri("https://maven.pkg.github.com/adotcode/adc.framework")
credentials {
username = System.getenv('GITHUB_USERNAME')
password = System.getenv('GITHUB_TOKEN')
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
//配置
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
compileOnly("org.projectlombok:lombok:$lombok")
annotationProcessor("org.projectlombok:lombok:$lombok")
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")
// Apache Commons
compile("org.apache.commons:commons-lang3:$commonsLang3")
compile("com.google.code.findbugs:annotations:$googleCodeFindbugs")
// 单元测试
testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
testCompile("org.junit:junit-bom:${junit5Version}")
}
}