spring-graphql ArtifactRepositoriesInitializer 源码
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 ArtifactRepositories 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦