-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
163 lines (140 loc) · 4.24 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
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
plugins {
id "java-library"
id 'maven-publish'
id("io.github.gradle-nexus.publish-plugin") version '1.1.0'
id 'signing'
}
allprojects {
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
}
mavenCentral()
}
buildscript {
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
}
def isRelease = false
group = 'com.sondertara'
version = '0.2.0'
archivesBaseName = 'joya'
sourceCompatibility = '1.8'
[compileJava, compileTestJava, javadoc]*.options*.encoding = "UTF-8"
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.tags = ['date:a:head']
options.encoding = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet')
}
java {
withJavadocJar()
withSourcesJar()
}
jar {
into('META-INF') {
from files('LICENSE')
}
manifest {
attributes('Built-By': 'Sondertara', 'Build-Jdk-Spec': '1.8')
}
}
dependencies {
implementation 'org.springframework.data:spring-data-jpa:2.6.3'
implementation 'org.springframework.boot:spring-boot:2.6.3'
implementation 'org.springframework:spring-web:5.3.14'
implementation 'org.hibernate:hibernate-core:5.6.8.Final'
implementation 'com.github.vertical-blank:sql-formatter:2.0.3'
implementation 'com.sondertara:common-tara:1.0.3'
compileOnly 'org.projectlombok:lombok:1.18.24'
compileOnly 'com.oracle.database.jdbc:ojdbc8:21.5.0.0'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
nexusPublishing {
repositories {
sonatype {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_USERNAME")
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'joya'
description = 'JPA extensions and dynamic query feature.'
url = 'https://github.com/sondertara/joya'
inceptionYear = '2021'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'sondertara'
name = 'huangxiaohu'
}
}
scm {
connection = 'scm:https://github.com/sondertara/joya.git'
developerConnection = 'scm:git@github.com:sondertara/joya.git'
url = 'https://github.com/sondertara/joya'
}
}
}
}
}
signing {
required { !project.version.endsWith("-SNAPSHOT") && !project.hasProperty("skipSigning") }
if (project.findProperty("signingKeyId")) {
def signingKey = findProperty("signingKey") as String
if (signingKey == null || signingKey.length() == 0) {
signingKey = file(project.findProperty("secretKeyRingFile")).getText()
}
def signingKeyId = findProperty("signingKeyId")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId as String, signingKey, signingPassword as String)
} else {
useGpgCmd()
}
sign publishing.publications.mavenJava
}
tasks.withType(InitializeNexusStagingRepository).configureEach {
if (!isRelease) {
return
}
shouldRunAfter(tasks.withType(Sign))
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}