forked from isxcode/spring-oxygen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
173 lines (139 loc) · 5.14 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'maven'
id 'maven-publish'
id 'signing'
id 'jacoco'
}
subprojects {
apply plugin: 'signing'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
version = project.findProperty('project.version') ?: '0.0.1'
group = project.findProperty('project.group')
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
if (project.findProperty('project.version') == null) {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
} else {
mavenCentral()
}
}
dependencies {
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'com.fasterxml.jackson.datatype', module: 'jackson-datatype-jdk8'
}
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
implementation 'org.apache.logging.log4j:log4j-api:2.14.0'
implementation 'org.junit.jupiter:junit-jupiter'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
}
// https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-gradle-for-use-with-github-packages
publishing {
repositories {
maven {
name = 'GitHubPackages'
def githubRepoUrl = 'https://maven.pkg.github.com/isxcode/spring-oxygen'
url = githubRepoUrl
credentials {
username = project.findProperty('gpr.user') ?: System.getenv('USERNAME')
password = project.findProperty('gpr.key') ?: System.getenv('TOKEN')
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
// https://docs.gradle.org/current/userguide/publishing_maven.html#header
publishing {
repositories {
maven {
name = "SonatypePackages"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.findProperty("sonatypeUsername") ?: System.getenv("SONATYPE_NAME")
password = project.findProperty("sonatypePassword") ?: System.getenv("SONATYPE_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.getName()
description = 'Spring rapid development integration framework.'
url = 'https://github.com/isxcode/spring-oxygen'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ispong'
name = 'ispong'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/isxcode/spring-oxygen.git'
developerConnection = 'scm:git:ssh://github.com/isxcode/spring-oxygen.git'
url = 'https://github.com/isxcode/spring-oxygen'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.encoding("UTF-8")
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// https://docs.gradle.org/current/userguide/jacoco_plugin.html#header
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.destination file("${buildDir}/jacocoHtml")
}
}
jacoco {
toolVersion = "0.8.5"
reportsDir = file("$buildDir/jacocoReport")
}
}
allprojects {
bootJar { enabled false }
jar { enabled true }
bootRun { enabled false }
}