Skip to content

Commit 261c7f2

Browse files
committed
update gradle and add vanniktech plugin
1 parent 4ad77e4 commit 261c7f2

File tree

4 files changed

+102
-53
lines changed

4 files changed

+102
-53
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g')
3838
sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties
3939
sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
40+
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_USERNAME,g" gradle.properties
41+
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
4042
sed -i -e "s,githubPassword=,githubPassword=$GITHUB_PASSWORD,g" gradle.properties
4143
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
4244
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties

build.gradle

Lines changed: 92 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript { // Configuration for building
55
}
66

77
plugins {
8+
id "com.vanniktech.maven.publish" version "0.34.0"
89
id 'java-library'
910
id 'maven-publish'
1011
id 'signing'
@@ -28,61 +29,100 @@ repositories { // repositories for Jar's you access in your code
2829
}
2930
mavenCentral()
3031
}
31-
32-
publishing {
33-
publications {
34-
authLib(MavenPublication) {
35-
pom {
36-
name = 'Fleet Engine Auth Library'
37-
description = 'Provides a set of tools to simplify the Fleet Engine setup process.'
38-
url = 'https://github.com/googlemaps/java-fleetengine-auth'
39-
licenses {
40-
license {
41-
name = 'The Apache License, Version 2.0'
42-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
43-
}
44-
}
45-
organization {
46-
name = 'Google, Inc.'
47-
url = 'http://www.google.com'
48-
}
49-
issueManagement {
50-
system = 'GitHub Issues'
51-
url = 'http://github.com/googlemaps/java-fleetengine-auth/issues'
52-
}
53-
scm {
54-
connection = 'scm:git:git://github.com/googlemaps/java-fleetengine-auth.git'
55-
developerConnection = 'scm:git:ssh://github.com/googlemaps/java-fleetengine-auth.git'
56-
url = 'http://github.com/googlemaps/java-fleetengine-auth/'
57-
tag = 'HEAD'
58-
}
59-
developers {
60-
developer {
61-
id = 'danielfbright'
62-
name = 'Daniel Bright'
63-
}
64-
}
32+
//
33+
//publishing {
34+
// publications {
35+
// authLib(MavenPublication) {
36+
// pom {
37+
// name = 'Fleet Engine Auth Library'
38+
// description = 'Provides a set of tools to simplify the Fleet Engine setup process.'
39+
// url = 'https://github.com/googlemaps/java-fleetengine-auth'
40+
// licenses {
41+
// license {
42+
// name = 'The Apache License, Version 2.0'
43+
// url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
44+
// }
45+
// }
46+
// organization {
47+
// name = 'Google, Inc.'
48+
// url = 'http://www.google.com'
49+
// }
50+
// issueManagement {
51+
// system = 'GitHub Issues'
52+
// url = 'http://github.com/googlemaps/java-fleetengine-auth/issues'
53+
// }
54+
// scm {
55+
// connection = 'scm:git:git://github.com/googlemaps/java-fleetengine-auth.git'
56+
// developerConnection = 'scm:git:ssh://github.com/googlemaps/java-fleetengine-auth.git'
57+
// url = 'http://github.com/googlemaps/java-fleetengine-auth/'
58+
// tag = 'HEAD'
59+
// }
60+
// developers {
61+
// developer {
62+
// id = 'danielfbright'
63+
// name = 'Daniel Bright'
64+
// }
65+
// }
66+
// }
67+
// groupId group
68+
// artifactId project.ext.artifactId
69+
// version version
70+
// from components.java
71+
// }
72+
// }
73+
// repositories {
74+
// maven {
75+
// name = "mavencentral"
76+
// url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
77+
// credentials {
78+
// username sonatypeUsername
79+
// password sonatypePassword
80+
// }
81+
// }
82+
// }
83+
//}
84+
85+
//import com.vanniktech.maven.publish.SonatypeHost
86+
87+
mavenPublishing {
88+
publishToMavenCentral()
89+
signAllPublications()
90+
pom {
91+
name = "Fleet Engine Auth Library"
92+
description = "Provides a set of tools to simplify the Fleet Engine setup process."
93+
url = "https://github.com/googlemaps/java-fleetengine-auth"
94+
licenses {
95+
license {
96+
name = "The Apache License, Version 2.0"
97+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
98+
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
6599
}
66-
groupId group
67-
artifactId project.ext.artifactId
68-
version version
69-
from components.java
70100
}
71-
}
72-
repositories {
73-
maven {
74-
name = "mavencentral"
75-
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
76-
credentials {
77-
username sonatypeUsername
78-
password sonatypePassword
101+
organization {
102+
name = 'Google, Inc.'
103+
url = 'http://www.google.com'
104+
}
105+
issueManagement {
106+
system = 'GitHub Issues'
107+
url = 'http://github.com/googlemaps/java-fleetengine-auth/issues'
108+
}
109+
scm {
110+
connection = 'scm:git:git://github.com/googlemaps/java-fleetengine-auth.git'
111+
developerConnection = 'scm:git:ssh://github.com/googlemaps/java-fleetengine-auth.git'
112+
url = 'http://github.com/googlemaps/java-fleetengine-auth/'
113+
tag = 'HEAD'
114+
}
115+
developers {
116+
developer {
117+
id.set("google")
118+
name.set("Google Inc.")
79119
}
80120
}
81121
}
82122
}
83123

84124
dependencies {
85-
compile 'jstl:jstl:1.2'
125+
implementation 'jstl:jstl:1.2'
86126

87127
annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
88128

@@ -101,18 +141,18 @@ dependencies {
101141
testImplementation 'org.mockito:mockito-core:3.12.4'
102142
}
103143

104-
signing {
105-
sign publishing.publications.authLib
106-
}
144+
//signing {
145+
// sign publishing.publications.authLib
146+
//}
107147

108148
task javadocJar(type: Jar) {
109-
classifier = 'javadoc'
149+
archiveClassifier = 'javadoc'
110150
from 'build/docs/javadoc'
111151
}
112152

113153
task sourcesJar(type: Jar) {
114154
from sourceSets.main.allSource
115-
classifier = 'sources'
155+
archiveClassifier = 'sources'
116156
}
117157

118158
artifacts {

gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ signing.secretKeyRingFile=
2222
sonatypeUsername=
2323
sonatypePassword=
2424

25+
mavenCentralUsername=
26+
mavenCentralPassword=
27+
28+
# Add a property to enable automatic release to Maven Central (optional, but good for CI)
29+
# If true, publishToMavenCentral will also close and release the staging repository
30+
mavenCentralAutomaticRelease=false
31+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)