-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (84 loc) · 2.88 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
buildscript {
apply from: 'config.gradle'
ext.FAST_MIRROR_REPO_URL = 'https://maven.aliyun.com/nexus/content/groups/public/'
repositories {
maven { url FAST_MIRROR_REPO_URL }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${jarVersion.springboot}")
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.jetwinner'
version = '0.9.27'
sourceCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
}
repositories {
mavenLocal()
maven { url FAST_MIRROR_REPO_URL }
mavenCentral()
}
dependencies {
compileOnly('com.google.code.findbugs:annotations:3.0.1')
implementation('org.springframework.boot:spring-boot-starter')
testImplementation('org.springframework.boot:spring-boot-starter-test')
}
jar {
enabled = true
bootJar.enabled = false
manifest {
attributes('Implementation-Title': 'Gradle')
}
}
test {
systemProperty 'spring.profiles.active', System.getProperty('spring.profiles.active')
}
processResources {
filesMatching('application.properties') {
expand(project.properties)
}
}
// 获取本地仓库路径
// def localRepositoryPath = 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
def localRepositoryPath = 'file://' + rootProject.projectDir.absolutePath + '/libs/repo'
uploadArchives { // 打包至本地仓库配置
repositories {
mavenDeployer { // mavenDeployer need apply plugin: 'maven'
repository(url: localRepositoryPath)
pom.project {
name = project.name
version = project.version
groupId = project.group
}
}
}
}
}
project.task('copyJar', type: Copy, dependsOn: subprojects.jar) {
from(subprojects.jar)
into project.file('dist')
}
project.task('copyJarToQuickStart', type: Copy, dependsOn: subprojects.jar) {
from(subprojects.jar)
exclude('webfast-module*.jar')
exclude('webfast-starter-demo*.jar')
into project.file('../webfast2quickstart/lib')
}
project.task('makeSourceZip', type: Zip) {
archiveBaseName = "${rootProject.name}-${subprojects.version[0]}"
from(project.rootDir) {
excludes = ['dist/**', '.gradle/**', '.idea/**', 'backup4dev/**', '**/out/**', '**/build/**']
}
into("${rootProject.name}")
destinationDirectory = file("../${rootProject.name}-backup4dev")
}