spring-graphql ArtifactRepositoriesInitializer 源码

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

spring-graphql ArtifactRepositoriesInitializer 代码

文件路径:/samples/webmvc-http/src/main/java/io/spring/sample/graphql/repository/ArtifactRepositoriesInitializer.java

package io.spring.sample.graphql.repository;

import java.util.Arrays;
import java.util.List;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class ArtifactRepositoriesInitializer implements ApplicationRunner {

	private final ArtifactRepositories repositories;

	public ArtifactRepositoriesInitializer(ArtifactRepositories repositories) {
		this.repositories = repositories;
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
		List<ArtifactRepository> repositoryList = Arrays.asList(
				new ArtifactRepository("spring-releases", "Spring Releases", "https://repo.spring.io/libs-releases"),
				new ArtifactRepository("spring-milestones", "Spring Milestones", "https://repo.spring.io/libs-milestones"),
				new ArtifactRepository("spring-snapshots", "Spring Snapshots", "https://repo.spring.io/libs-snapshots"));
		repositories.saveAll(repositoryList);
	}

}

相关信息

spring-graphql 源码目录

相关文章

spring-graphql ArtifactRepositories 源码

spring-graphql ArtifactRepository 源码

spring-graphql package-info 源码

0  赞