-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
114 lines (97 loc) · 3.12 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.8.0"
`maven-publish`
`signing`
}
group = "io.github.devzwy"
version = "3.0.8"
val sourceJar by tasks.registering(Jar::class) {
from(sourceSets["main"].allSource)
archiveClassifier.set("sources")
}
tasks.withType<Javadoc> {
options {
encoding = "UTF-8"
}
}
val javadocJar by tasks.creating(Jar::class) {
classifier = "javadoc"
from(tasks.getByName<Javadoc>("javadoc"))
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
// from(components["kotlin"])
groupId = "io.github.devzwy"
artifactId = "mdhelper"
version = project.version as String?
// 发布 Javadoc JAR
artifact(javadocJar)
artifact(sourceJar)
pom {
name.set("mdhelper")
description.set("明道云工具类,封装了基础的增删改查操作。适用于Java、Android")
url.set("https://github.com/devzwy/mdhelper")
scm {
url.set("https://github.com/devzwy/mdhelper.git") // 添加 SCM URL
connection.set("scm:git:https://github.com/devzwy/mdhelper.git")
developerConnection.set("scm:git:https://github.com/devzwy/mdhelper.git")
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("dev_zwy")
name.set("devzwy")
email.set("[email protected]")
}
}
}
}
}
repositories {
maven {
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("mavenUser") as String? ?: System.getenv("MAVEN_USERNAME")
password = project.findProperty("mavenPassword") as String? ?: System.getenv("MAVEN_PASSWORD")
}
}
}
}
repositories {
//https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
//https://oss.sonatype.org/content/repositories/releases/
maven { url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") }
mavenLocal()
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
jcenter()
maven {
url = uri("https://maven.aliyun.com/repository/public")
}
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
}
configure<SigningExtension> {
sign(publishing.publications["mavenJava"])
}
dependencies {
testImplementation(kotlin("test"))
implementation("com.alibaba.fastjson2:fastjson2:2.0.47")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}