This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
201 lines (166 loc) · 5.96 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import java.time.LocalDateTime
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
}
plugins {
id "io.freefair.lombok" version "6.5.1"
id "org.springframework.boot" version "3.1.1"
id "com.github.hierynomus.license" version "0.16.1"
id "io.spring.dependency-management" version "1.1.0"
}
allprojects {
group = 'com.opcooc'
version = project.opcoocVersion
}
description = "opcooc-storage-spring-boot-starter - 简单对象存储客户端驱动程序"
apply plugin: 'signing'
//apply plugin: 'checkstyle'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: "io.freefair.lombok"
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
//checkstyle {
// configFile = file("style/checkstyle.xml") //指定checkstyle配置文件
// toolVersion = "8.37" //指定checkstyle工具的版本,部分style规则有版本要求
//
// //有警告时是否允许构建继续进行.
// ignoreFailures = false
//
// //是否在控制台上显示违反规则.
// showViolations = true
//}
tasks.withType(JavaCompile) {
options.encoding = project.encoding
options.warnings = false
options.deprecation = true
options.compilerArgs += ["-parameters"]
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
jar {
afterEvaluate {
manifest {
attributes 'Implementation-Title': archiveBaseName
attributes 'Implementation-Version': archiveVersion
attributes 'Built-Gradle': gradle.gradleVersion
attributes 'Bundle-DocURL': 'https://github.com/opcooc/opcooc-storage-spring-boot-starter'
attributes 'Build-OS': System.getProperty("os.name")
attributes 'Built-By': System.getProperty("user.name")
attributes 'Build-Jdk': System.getProperty("java.version")
attributes 'Build-Timestamp': LocalDateTime.now().format("yyyy-MM-dd HH:mm:ss")
}
}
archiveClassifier = ''
}
license {
encoding = project.encoding
header = rootProject.file("license.txt")
includes(["**/*.java"])
exclude "**/test/**/*.java"
exclude "**/*Test.java"
mapping "java", "SLASHSTAR_STYLE"
ignoreFailures = true
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
api 'com.amazonaws:aws-java-sdk-s3:1.12.495'
api "org.springframework.boot:spring-boot-autoconfigure"
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
implementation "org.springframework.boot:spring-boot-autoconfigure-processor"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
implementation "org.springframework.boot:spring-boot-configuration-processor"
implementation "org.springframework.boot:spring-boot-starter-aop"
implementation "org.springframework.boot:spring-boot-starter-web"
// checkstyle 'com.thomasjensen.checkstyle.addons:checkstyle-addons:7.0.1'
implementation 'org.slf4j:slf4j-api:2.0.6'
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
afterEvaluate {
configure(options) {
encoding project.encoding
charSet project.encoding
author true
version true
failOnError false
links "https://docs.oracle.com/javase/17/docs/api"
}
}
}
test {
dependsOn("cleanTest", "generatePomFileForMavenJavaPublication")
useJUnitPlatform()
exclude("**/storage/**")
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
tasks.whenTaskAdded { task ->
if (task.name.contains('signMavenJavaPublication')) {
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
}
}
publishing {
repositories {
maven {
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.sonatypeUsername
password project.sonatypePassword
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "opcooc-storage-spring-boot-starter"
packaging 'jar'
description = 'opcooc-storage-spring-boot-starter simple object storage client driver'
url = 'https://github.com/opcooc/opcooc-storage-spring-boot-starter'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'opcooc'
name = 'shenqicheng'
email = '[email protected]'
}
}
scm {
url = 'https://github.com/opcooc/opcooc-storage-spring-boot-starter'
connection = 'scm:git:https://github.com/opcooc/opcooc-storage-spring-boot-starter'
developerConnection = 'scm:git:[email protected]:opcooc/opcooc-storage-spring-boot-starter.git'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}