-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
121 lines (109 loc) · 3.92 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
// 插件配置
plugins {
id 'java-library'
id 'idea'
id 'maven-publish'
id 'signing'
}
group 'org.dong.kafka'
version '1.0.5'
//jdk版本
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
api('org.springframework.kafka:spring-kafka:2.8.2')
implementation(
'org.springframework.boot:spring-boot-starter:2.6.3',
'com.alibaba:fastjson:1.2.83',
'cn.hutool:hutool-all:5.8.16',
'org.apache.commons:commons-lang3:3.12.0',
'com.google.guava:guava:31.0.1-jre'
)
annotationProcessor(
"org.springframework.boot:spring-boot-configuration-processor:2.6.3",
'org.projectlombok:lombok:1.18.22',
)
compileOnly('org.projectlombok:lombok:1.18.22')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.8.2')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.8.2')
}
// 编码方式
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
java {
withJavadocJar() //生成java-doc
withSourcesJar() //生成源码,上传后方便查看
}
jar {
enabled = true //生成依赖jar包
archiveClassifier = '' //取消原来plain的后缀
}
// javadoc 配置,这里是自定义了 java doc 的一些配置
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.version = true
options.header = project.name
options.addStringOption('Xdoclint:none', '-quiet')
// suppress warnings due to cross-module @see and @link references;
// note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
options.encoding = "UTF-8" //编码一定要配置否则直接出错
options.charSet = 'UTF-8'
}
publishing {
publications {
maven(MavenPublication) {
groupId "io.github.pg-liudong"
artifactId "$project.name"
version "$version"
from components.java
pom {
name = 'kafka-spring-boot-starter'
description = 'Encapsulation based on spring-kafka not only supports native configuration, but also adds multi data source configuration.'
url = 'https://github.com/pg-liudong/kafka-spring-boot-starter'
packaging 'jar'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'liudong'
name = 'liudong'
email = 'pg.liudong@qq.com'
}
}
scm {
connection = "scm:git:https://github.com/pg-liudong/kafka-spring-boot-starter"
developerConnection = "scm:git:https://github.com/pg-liudong/kafka-spring-boot-starter.git"
url = "https://github.com/pg-liudong/kafka-spring-boot-starter.git"
}
}
}
}
repositories {
mavenLocal()
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = "${NEXUS_USERNAME}"
password = "${NEXUS_PASSWORD}"
}
}
}
}
// 将构建的包签名
signing {
sign publishing.publications.maven
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}