Skip to content

Commit d11fe91

Browse files
committed
Gradle升级到7.2;编码使用UTF-8.
1 parent 7f1aad9 commit d11fe91

File tree

8 files changed

+428
-433
lines changed

8 files changed

+428
-433
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
eclipse.preferences.version=1
2-
encoding/build.gradle=UTF-8
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
3+
encoding/build.gradle=UTF-8

build.gradle

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
1-
//打包: gradlew -x test clean build 成功后发布:gradlew -x test publish
1+
//打包: gradlew -x test clean build shadowJar 成功后发布:gradlew -x test publish
22
//然后登录https://oss.sonatype.org/#stagingRepositories来查看,你的提交在未处理前,是`open`状态,然后点击`Close`按钮;然后等一会点击`Release`来发布
33

4-
buildscript {
5-
repositories {
6-
mavenLocal()
7-
maven { url "https://plugins.gradle.org/m2/"}
8-
mavenCentral()
9-
jcenter()
10-
}
11-
dependencies {
12-
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
13-
}
4+
plugins {
5+
id 'com.github.johnrengelman.shadow' version '7.1.0'
6+
id 'java'
7+
id 'maven-publish'
8+
id 'signing' //使用signing plugin做数字签名
149
}
1510

16-
apply plugin: 'java'
17-
apply plugin: 'maven-publish'
18-
apply plugin: 'com.github.johnrengelman.shadow'
19-
apply plugin: 'signing' //使用signing plugin做数字签名
20-
2111
//密码,GPG签名信息在此文件里,格式如下
2212
/*
2313
ext.'signing.keyId' = '密钥keyId'
@@ -33,18 +23,20 @@ defaultTasks 'shadowJar'
3323

3424
group = 'com.github.wjw465150' //Sonatype上的Issue里填写的`Group Id`,可以跟package路径完全不一样
3525
version = "2.11.4"
26+
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
3627

3728
repositories {
3829
mavenLocal()
39-
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" } //优先使用阿里的镜像 mavenCentral()
30+
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" } //优先使用阿里的镜像
31+
mavenCentral()
4032
//flatDir(dirs: file('jarsDerectory'))
4133
}
4234

4335

4436
dependencies {
45-
compile "com.fasterxml.jackson.core:jackson-core:${project.version}"
46-
compile "com.fasterxml.jackson.core:jackson-annotations:${project.version}"
47-
compile "com.fasterxml.jackson.core:jackson-databind:${project.version}"
37+
implementation "com.fasterxml.jackson.core:jackson-core:${project.version}"
38+
implementation "com.fasterxml.jackson.core:jackson-annotations:${project.version}"
39+
implementation "com.fasterxml.jackson.core:jackson-databind:${project.version}"
4840

4941
//或者: compile fileTree(dir: "lib", includes: ["*.jar"])
5042
}
@@ -81,12 +73,14 @@ task javadocJar(type: Jar, dependsOn: [shadowJar]) {
8173
task sourcesJar(type: Jar) {
8274
from sourceSets.main.allSource
8375
classifier = 'sources'
76+
77+
duplicatesStrategy = 'EXCLUDE'
8478
}
8579

8680
shadowJar {
87-
baseName = project.name
88-
classifier = null
89-
version = project.version
81+
archiveBaseName.set(project.name)
82+
archiveClassifier.set('')
83+
archiveVersion.set(project.version)
9084

9185
relocate 'com.fasterxml.jackson', 'org.wjw.efjson.deps.com.fasterxml.jackson'
9286

@@ -101,8 +95,7 @@ shadowJar {
10195
attributes "Build-Version": "${project.version}"
10296
}
10397

104-
javadoc.execute()
105-
98+
dependsOn javadoc
10699
}
107100

108101
publishing {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
3+
//distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

lib/jackson-annotations-2.11.4.jar

-70.4 KB
Binary file not shown.

lib/jackson-core-2.11.4.jar

-343 KB
Binary file not shown.

lib/jackson-databind-2.11.4.jar

-1.36 MB
Binary file not shown.

lib/jarjar-1.4.jar

-118 KB
Binary file not shown.

0 commit comments

Comments
 (0)