spring-session SpringNexusPublishPlugin 源码

  • 2022-08-16
  • 浏览 (451)

spring-session SpringNexusPublishPlugin 代码

文件路径:/buildSrc/src/main/java/org/springframework/gradle/maven/SpringNexusPublishPlugin.java

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));
	}
}

相关信息

spring-session 源码目录

相关文章

spring-session MavenPublishingConventionsPlugin 源码

spring-session PublishAllJavaComponentsPlugin 源码

spring-session PublishArtifactsPlugin 源码

spring-session PublishLocalPlugin 源码

spring-session SpringMavenPlugin 源码

spring-session SpringSigningPlugin 源码

0  赞