@@ -182,8 +182,7 @@ fun Project.configureNexusPublishing(repoName: String, githubOrganization: Strin
182182}
183183
184184/* *
185- * Configure publishing for this project. This applies the `maven-publish` and `signing` plugins and configures
186- * the publications.
185+ * Configure publishing for this project. This applies the `maven-publish` plugin and configures publications.
187186 * @param repoName the repository name (e.g. `smithy-kotlin`, `aws-sdk-kotlin`, etc)
188187 * @param githubOrganization the name of the GitHub organization that [repoName] is located in
189188 */
@@ -236,23 +235,6 @@ fun Project.configurePublishing(repoName: String, githubOrganization: String = "
236235 }
237236 }
238237 }
239-
240- val secretKey = System .getenv(EnvironmentVariables .GPG_SECRET_KEY )
241- val passphrase = System .getenv(EnvironmentVariables .GPG_PASSPHRASE )
242-
243- if (! secretKey.isNullOrBlank() && ! passphrase.isNullOrBlank()) {
244- apply (plugin = " signing" )
245- extensions.configure<SigningExtension > {
246- useInMemoryPgpKeys(secretKey, passphrase)
247- sign(publications)
248- }
249-
250- // FIXME - workaround for https://github.com/gradle/gradle/issues/26091
251- val signingTasks = tasks.withType<Sign >()
252- tasks.withType<AbstractPublishToMaven >().configureEach {
253- mustRunAfter(signingTasks)
254- }
255- }
256238 }
257239
258240 tasks.withType<AbstractPublishToMaven >().configureEach {
@@ -312,6 +294,9 @@ fun Project.configureJReleaser() {
312294 val requiredVariables = listOf (
313295 EnvironmentVariables .MAVEN_CENTRAL_USERNAME ,
314296 EnvironmentVariables .MAVEN_CENTRAL_TOKEN ,
297+ EnvironmentVariables .GPG_PASSPHRASE ,
298+ EnvironmentVariables .GPG_PUBLIC_KEY ,
299+ EnvironmentVariables .GPG_SECRET_KEY ,
315300 EnvironmentVariables .GENERIC_TOKEN ,
316301 )
317302
@@ -346,6 +331,11 @@ fun Project.configureJReleaser() {
346331 version = providers.gradleProperty(" sdkVersion" ).get()
347332 }
348333
334+ signing {
335+ active = Active .ALWAYS
336+ armored = true
337+ }
338+
349339 // JReleaser requires a releaser to be configured even though we don't use it.
350340 // https://github.com/jreleaser/jreleaser/discussions/1725#discussioncomment-10674529
351341 release {
@@ -365,7 +355,6 @@ fun Project.configureJReleaser() {
365355 mavenCentral {
366356 create(" maven-central" ) {
367357 active = Active .ALWAYS // the Maven deployer default is ALWAYS, but MavenCentral is NEVER
368- sign = false // Signing is done when publishing, see the 'configurePublishing' function
369358 url = " https://central.sonatype.com/api/v1/publisher"
370359 stagingRepository(rootProject.layout.buildDirectory.dir(" m2" ).get().toString())
371360 artifacts {
0 commit comments