15 changed files with 292 additions and 247 deletions
@ -1,212 +0,0 @@ |
|||||||
package io.spring.gradle.convention |
|
||||||
|
|
||||||
import org.gradle.api.Plugin |
|
||||||
import org.gradle.api.Project |
|
||||||
import org.gradle.api.XmlProvider |
|
||||||
import org.gradle.api.artifacts.component.ModuleComponentSelector |
|
||||||
import org.gradle.api.artifacts.maven.MavenDeployment |
|
||||||
import org.gradle.api.artifacts.maven.MavenPom |
|
||||||
import org.gradle.api.artifacts.result.ResolvedDependencyResult |
|
||||||
import org.gradle.api.plugins.JavaBasePlugin |
|
||||||
import org.gradle.api.plugins.JavaPlugin |
|
||||||
import org.gradle.api.plugins.JavaPluginConvention |
|
||||||
import org.gradle.api.plugins.MavenPlugin |
|
||||||
import org.gradle.api.tasks.SourceSet |
|
||||||
import org.gradle.api.tasks.bundling.Jar |
|
||||||
import org.gradle.api.tasks.javadoc.Javadoc |
|
||||||
import org.gradle.plugins.signing.SigningPlugin |
|
||||||
import org.slf4j.Logger |
|
||||||
import org.slf4j.LoggerFactory |
|
||||||
|
|
||||||
public class SpringMavenPlugin implements Plugin<Project> { |
|
||||||
private static final String ARCHIVES = "archives"; |
|
||||||
Logger logger = LoggerFactory.getLogger(getClass()); |
|
||||||
|
|
||||||
@Override |
|
||||||
public void apply(Project project) { |
|
||||||
project.getPluginManager().apply(JavaPlugin.class); |
|
||||||
project.getPluginManager().apply(MavenPlugin.class); |
|
||||||
project.getPluginManager().apply(SigningPlugin.class); |
|
||||||
|
|
||||||
Javadoc javadoc = (Javadoc) project.getTasks().findByPath("javadoc"); |
|
||||||
Jar javadocJar = project.getTasks().create("javadocJar", Jar.class); |
|
||||||
javadocJar.setClassifier("javadoc"); |
|
||||||
javadocJar.from(javadoc); |
|
||||||
|
|
||||||
JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class); |
|
||||||
SourceSet mainSourceSet = java.getSourceSets().getByName("main"); |
|
||||||
Jar sourcesJar = project.getTasks().create("sourcesJar", Jar.class); |
|
||||||
sourcesJar.setClassifier("sources"); |
|
||||||
sourcesJar.from(mainSourceSet.getAllSource()); |
|
||||||
|
|
||||||
project.getArtifacts().add(ARCHIVES, javadocJar); |
|
||||||
project.getArtifacts().add(ARCHIVES, sourcesJar); |
|
||||||
|
|
||||||
project.install { |
|
||||||
repositories.mavenInstaller { |
|
||||||
configurePom(project, pom) |
|
||||||
} |
|
||||||
} |
|
||||||
project.uploadArchives { |
|
||||||
repositories.mavenDeployer { |
|
||||||
configurePom(project, pom) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
inlineDependencyManagement(project); |
|
||||||
|
|
||||||
def hasSigningKey = project.hasProperty("signing.keyId") || project.findProperty("signingKey") |
|
||||||
if(hasSigningKey && Utils.isRelease(project)) { |
|
||||||
sign(project) |
|
||||||
} |
|
||||||
|
|
||||||
project.getPluginManager().apply("io.spring.convention.ossrh"); |
|
||||||
} |
|
||||||
|
|
||||||
private void inlineDependencyManagement(Project project) { |
|
||||||
project.install { |
|
||||||
repositories.mavenInstaller { |
|
||||||
configurePomForInlineDependencies(project, pom) |
|
||||||
} |
|
||||||
} |
|
||||||
project.uploadArchives { |
|
||||||
repositories.mavenDeployer { |
|
||||||
configurePomForInlineDependencies(project, pom) |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private void configurePomForInlineDependencies(Project project, MavenPom pom) { |
|
||||||
pom.withXml { XmlProvider xml -> |
|
||||||
project.plugins.withType(JavaBasePlugin) { |
|
||||||
def dependencies = xml.asNode()?.dependencies?.dependency |
|
||||||
def configuredDependencies = project.configurations.findAll{ it.canBeResolved && it.canBeConsumed }*.incoming*.resolutionResult*.allDependencies.flatten() |
|
||||||
dependencies?.each { Node dep -> |
|
||||||
def group = dep.groupId.text() |
|
||||||
def name = dep.artifactId.text() |
|
||||||
|
|
||||||
ResolvedDependencyResult resolved = configuredDependencies.find { r -> |
|
||||||
(r.requested instanceof ModuleComponentSelector) && |
|
||||||
(r.requested.group == group) && |
|
||||||
(r.requested.module == name) |
|
||||||
} |
|
||||||
|
|
||||||
if (!resolved) { |
|
||||||
return |
|
||||||
} |
|
||||||
|
|
||||||
def versionNode = dep.version |
|
||||||
if (!versionNode) { |
|
||||||
dep.appendNode('version') |
|
||||||
} |
|
||||||
def moduleVersion = resolved.selected.moduleVersion |
|
||||||
dep.groupId[0].value = moduleVersion.group |
|
||||||
dep.artifactId[0].value = moduleVersion.name |
|
||||||
dep.version[0].value = moduleVersion.version |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private void sign(Project project) { |
|
||||||
project.install { |
|
||||||
repositories { |
|
||||||
mavenDeployer { |
|
||||||
beforeDeployment { MavenDeployment deployment -> project.signing.signPom(deployment) } |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
project.uploadArchives { |
|
||||||
repositories { |
|
||||||
mavenDeployer { |
|
||||||
beforeDeployment { MavenDeployment deployment -> project.signing.signPom(deployment) } |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
project.signing { |
|
||||||
required { project.gradle.taskGraph.hasTask("uploadArchives") } |
|
||||||
def signingKeyId = project.findProperty("signingKeyId") |
|
||||||
def signingKey = project.findProperty("signingKey") |
|
||||||
def signingPassword = project.findProperty("signingPassword") |
|
||||||
if (signingKeyId) { |
|
||||||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) |
|
||||||
} else if (signingKey) { |
|
||||||
useInMemoryPgpKeys(signingKey, signingPassword) |
|
||||||
} |
|
||||||
sign project.configurations.archives |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private static void configurePom(Project project, MavenPom pom) { |
|
||||||
pom.whenConfigured { p -> |
|
||||||
p.dependencies = p.dependencies.sort { dep -> |
|
||||||
"$dep.scope:$dep.optional:$dep.groupId:$dep.artifactId" |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
pom.project { |
|
||||||
boolean isWar = project.hasProperty("war"); |
|
||||||
String projectVersion = String.valueOf(project.getVersion()); |
|
||||||
String projectName = Utils.getProjectName(project); |
|
||||||
|
|
||||||
if(isWar) { |
|
||||||
packaging = "war" |
|
||||||
} |
|
||||||
name = project.name |
|
||||||
description = project.name |
|
||||||
url = 'https://spring.io/spring-security' |
|
||||||
organization { |
|
||||||
name = 'spring.io' |
|
||||||
url = 'https://spring.io/' |
|
||||||
} |
|
||||||
licenses { |
|
||||||
license { |
|
||||||
name 'The Apache Software License, Version 2.0' |
|
||||||
url 'https://www.apache.org/licenses/LICENSE-2.0.txt' |
|
||||||
distribution 'repo' |
|
||||||
} |
|
||||||
} |
|
||||||
scm { |
|
||||||
url = 'https://github.com/spring-projects/spring-security' |
|
||||||
connection = 'scm:git:git://github.com/spring-projects/spring-security' |
|
||||||
developerConnection = 'scm:git:git://github.com/spring-projects/spring-security' |
|
||||||
} |
|
||||||
developers { |
|
||||||
developer { |
|
||||||
id = 'rwinch' |
|
||||||
name = 'Rob Winch' |
|
||||||
email = 'rwinch@pivotal.io' |
|
||||||
} |
|
||||||
developer { |
|
||||||
id = 'jgrandja' |
|
||||||
name = 'Joe Grandja' |
|
||||||
email = 'jgrandja@pivotal.io' |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
if(isWar) { |
|
||||||
properties { |
|
||||||
'm2eclipse.wtp.contextRoot' '/' |
|
||||||
} |
|
||||||
} |
|
||||||
if (Utils.isSnapshot(project)) { |
|
||||||
repositories { |
|
||||||
repository { |
|
||||||
id 'spring-snapshot' |
|
||||||
url 'https://repo.spring.io/snapshot' |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
else if (Utils.isMilestone(project)) { |
|
||||||
repositories { |
|
||||||
repository { |
|
||||||
id 'spring-milestone' |
|
||||||
url 'https://repo.spring.io/milestone' |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -0,0 +1,78 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.plugins.JavaPlugin; |
||||||
|
import org.gradle.api.plugins.JavaPluginExtension; |
||||||
|
import org.gradle.api.publish.PublishingExtension; |
||||||
|
import org.gradle.api.publish.maven.MavenPom; |
||||||
|
import org.gradle.api.publish.maven.MavenPomDeveloperSpec; |
||||||
|
import org.gradle.api.publish.maven.MavenPomIssueManagement; |
||||||
|
import org.gradle.api.publish.maven.MavenPomLicenseSpec; |
||||||
|
import org.gradle.api.publish.maven.MavenPomOrganization; |
||||||
|
import org.gradle.api.publish.maven.MavenPomScm; |
||||||
|
import org.gradle.api.publish.maven.MavenPublication; |
||||||
|
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; |
||||||
|
|
||||||
|
public class MavenPublishingConventionsPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> { |
||||||
|
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); |
||||||
|
publishing.getPublications().withType(MavenPublication.class) |
||||||
|
.all((mavenPublication) -> customizePom(mavenPublication.getPom(), project)); |
||||||
|
customizeJavaPlugin(project); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizePom(MavenPom pom, Project project) { |
||||||
|
pom.getUrl().set("https://spring.io/projects/spring-security"); |
||||||
|
pom.getName().set(project.provider(project::getName)); |
||||||
|
pom.getDescription().set(project.provider(project::getDescription)); |
||||||
|
pom.organization(this::customizeOrganization); |
||||||
|
pom.licenses(this::customizeLicences); |
||||||
|
pom.developers(this::customizeDevelopers); |
||||||
|
pom.scm((scm) -> customizeScm(scm)); |
||||||
|
pom.issueManagement(this::customizeIssueManagement); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeOrganization(MavenPomOrganization organization) { |
||||||
|
organization.getName().set("Pivotal Software, Inc."); |
||||||
|
organization.getUrl().set("https://spring.io"); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeLicences(MavenPomLicenseSpec licences) { |
||||||
|
licences.license((licence) -> { |
||||||
|
licence.getName().set("Apache License, Version 2.0"); |
||||||
|
licence.getUrl().set("https://www.apache.org/licenses/LICENSE-2.0"); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeDevelopers(MavenPomDeveloperSpec developers) { |
||||||
|
developers.developer((developer) -> { |
||||||
|
developer.getName().set("Pivotal"); |
||||||
|
developer.getEmail().set("info@pivotal.io"); |
||||||
|
developer.getOrganization().set("Pivotal Software, Inc."); |
||||||
|
developer.getOrganizationUrl().set("https://www.spring.io"); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeScm(MavenPomScm scm) { |
||||||
|
scm.getConnection().set("scm:git:git://github.com/spring-projects/spring-security.git"); |
||||||
|
scm.getDeveloperConnection().set("scm:git:ssh://git@github.com/spring-projects/spring-security.git"); |
||||||
|
scm.getUrl().set("https://github.com/spring-projects/spring-security"); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeIssueManagement(MavenPomIssueManagement issueManagement) { |
||||||
|
issueManagement.getSystem().set("GitHub"); |
||||||
|
issueManagement.getUrl().set("https://github.com/spring-projects/spring-security/issues"); |
||||||
|
} |
||||||
|
|
||||||
|
private void customizeJavaPlugin(Project project) { |
||||||
|
project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> { |
||||||
|
JavaPluginExtension extension = project.getExtensions().getByType(JavaPluginExtension.class); |
||||||
|
extension.withJavadocJar(); |
||||||
|
extension.withSourcesJar(); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
|
||||||
|
import org.gradle.api.Action; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.plugins.JavaPlatformPlugin; |
||||||
|
import org.gradle.api.publish.PublishingExtension; |
||||||
|
import org.gradle.api.publish.maven.MavenPublication; |
||||||
|
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; |
||||||
|
|
||||||
|
public class PublishAllJavaComponentsPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> { |
||||||
|
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); |
||||||
|
publishing.getPublications().create("maven", MavenPublication.class, new Action<MavenPublication>() { |
||||||
|
@Override |
||||||
|
public void execute(MavenPublication maven) { |
||||||
|
project.getPlugins().withType(JavaPlatformPlugin.class) |
||||||
|
.all((javaPlugin) -> project.getComponents() |
||||||
|
.matching((component) -> component.getName().equals("javaPlatform")) |
||||||
|
.all((javaComponent) -> maven.from(javaComponent))); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import io.spring.gradle.convention.Utils; |
||||||
|
import org.gradle.api.Action; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.Task; |
||||||
|
|
||||||
|
public class PublishArtifactsPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getTasks().register("publishArtifacts", new Action<Task>() { |
||||||
|
@Override |
||||||
|
public void execute(Task publishArtifacts) { |
||||||
|
publishArtifacts.setGroup("Publishing"); |
||||||
|
publishArtifacts.setDescription("Publish the artifacts to either Artifactory or Maven Central based on the version"); |
||||||
|
if (Utils.isRelease(project)) { |
||||||
|
publishArtifacts.dependsOn("publishToOssrh"); |
||||||
|
} |
||||||
|
else { |
||||||
|
publishArtifacts.dependsOn("artifactoryPublish"); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import org.gradle.api.Action; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.artifacts.repositories.MavenArtifactRepository; |
||||||
|
import org.gradle.api.publish.PublishingExtension; |
||||||
|
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
|
public class PublishLocalPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getPlugins().withType(MavenPublishPlugin.class).all(new Action<MavenPublishPlugin>() { |
||||||
|
@Override |
||||||
|
public void execute(MavenPublishPlugin mavenPublish) { |
||||||
|
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); |
||||||
|
publishing.getRepositories().maven(new Action<MavenArtifactRepository>() { |
||||||
|
@Override |
||||||
|
public void execute(MavenArtifactRepository maven) { |
||||||
|
maven.setName("local"); |
||||||
|
maven.setUrl(new File(project.getRootDir(), "publications/repos")); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import io.spring.gradle.convention.ArtifactoryPlugin; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.plugins.PluginManager; |
||||||
|
|
||||||
|
public class SpringMavenPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
PluginManager pluginManager = project.getPluginManager(); |
||||||
|
pluginManager.apply(SpringSigningPlugin.class); |
||||||
|
pluginManager.apply(SpringMavenPlugin.class); |
||||||
|
pluginManager.apply(MavenPublishingConventionsPlugin.class); |
||||||
|
pluginManager.apply(PublishAllJavaComponentsPlugin.class); |
||||||
|
pluginManager.apply(PublishLocalPlugin.class); |
||||||
|
pluginManager.apply(PublishArtifactsPlugin.class); |
||||||
|
pluginManager.apply(ArtifactoryPlugin.class); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import io.github.gradlenexus.publishplugin.NexusPublishExtension; |
||||||
|
import io.github.gradlenexus.publishplugin.NexusPublishPlugin; |
||||||
|
import io.github.gradlenexus.publishplugin.NexusRepository; |
||||||
|
import org.gradle.api.Action; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
|
||||||
|
import java.net.URI; |
||||||
|
import java.time.Duration; |
||||||
|
|
||||||
|
public class SpringNexusPublishPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getPlugins().apply(NexusPublishPlugin.class); |
||||||
|
NexusPublishExtension nexusPublishing = project.getExtensions().findByType(NexusPublishExtension.class); |
||||||
|
nexusPublishing.getRepositories().create("ossrh", new Action<NexusRepository>() { |
||||||
|
@Override |
||||||
|
public void execute(NexusRepository nexusRepository) { |
||||||
|
nexusRepository.getNexusUrl().set(URI.create("https://s01.oss.sonatype.org/service/local/")); |
||||||
|
nexusRepository.getSnapshotRepositoryUrl().set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/")); |
||||||
|
} |
||||||
|
}); |
||||||
|
nexusPublishing.getConnectTimeout().set(Duration.ofMinutes(3)); |
||||||
|
nexusPublishing.getClientTimeout().set(Duration.ofMinutes(3)); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,70 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2016-2019 the original author or authors. |
||||||
|
* |
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||||
|
* use this file except in compliance with the License. You may obtain a copy of |
||||||
|
* the License at |
||||||
|
* |
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||||
|
* License for the specific language governing permissions and limitations under |
||||||
|
* the License. |
||||||
|
*/ |
||||||
|
|
||||||
|
package org.springframework.gradle.maven; |
||||||
|
|
||||||
|
import org.gradle.api.Action; |
||||||
|
import org.gradle.api.Plugin; |
||||||
|
import org.gradle.api.Project; |
||||||
|
import org.gradle.api.publish.Publication; |
||||||
|
import org.gradle.api.publish.PublishingExtension; |
||||||
|
import org.gradle.api.publish.plugins.PublishingPlugin; |
||||||
|
import org.gradle.plugins.signing.SigningExtension; |
||||||
|
import org.gradle.plugins.signing.SigningPlugin; |
||||||
|
|
||||||
|
import java.util.concurrent.Callable; |
||||||
|
|
||||||
|
public class SpringSigningPlugin implements Plugin<Project> { |
||||||
|
@Override |
||||||
|
public void apply(Project project) { |
||||||
|
project.getPluginManager().apply(SigningPlugin.class); |
||||||
|
project.getPlugins().withType(SigningPlugin.class).all(new Action<SigningPlugin>() { |
||||||
|
@Override |
||||||
|
public void execute(SigningPlugin signingPlugin) { |
||||||
|
boolean hasSigningKey = project.hasProperty("signing.keyId") || project.hasProperty("signingKey"); |
||||||
|
if (hasSigningKey) { |
||||||
|
sign(project); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void sign(Project project) { |
||||||
|
SigningExtension signing = project.getExtensions().findByType(SigningExtension.class); |
||||||
|
signing.setRequired(new Callable<Boolean>() { |
||||||
|
@Override |
||||||
|
public Boolean call() throws Exception { |
||||||
|
return project.getGradle().getTaskGraph().hasTask("publishArtifacts"); |
||||||
|
} |
||||||
|
}); |
||||||
|
String signingKeyId = (String) project.findProperty("signingKeyId"); |
||||||
|
String signingKey = (String) project.findProperty("signingKey"); |
||||||
|
String signingPassword = (String) project.findProperty("signingPassword"); |
||||||
|
if (signingKeyId != null) { |
||||||
|
signing.useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword); |
||||||
|
} else { |
||||||
|
signing.useInMemoryPgpKeys(signingKey, signingPassword); |
||||||
|
} |
||||||
|
project.getPlugins().withType(PublishingPlugin.class).all(new Action<PublishingPlugin>() { |
||||||
|
@Override |
||||||
|
public void execute(PublishingPlugin publishingPlugin) { |
||||||
|
PublishingExtension publishing = project.getExtensions().findByType(PublishingExtension.class); |
||||||
|
Publication maven = publishing.getPublications().getByName("maven"); |
||||||
|
signing.sign(maven); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
@ -1 +0,0 @@ |
|||||||
implementation-class=io.spring.gradle.convention.SpringMavenPlugin |
|
||||||
Loading…
Reference in new issue