• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DependencyResolutionContext类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.springframework.boot.cli.compiler.grape.DependencyResolutionContext的典型用法代码示例。如果您正苦于以下问题:Java DependencyResolutionContext类的具体用法?Java DependencyResolutionContext怎么用?Java DependencyResolutionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DependencyResolutionContext类属于org.springframework.boot.cli.compiler.grape包,在下文中一共展示了DependencyResolutionContext类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

点赞 3

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
@Before
public void setUp() {
	MockitoAnnotations.initMocks(this);
	given(this.resolver.getGroupId("spring-boot-starter-logging"))
			.willReturn("org.springframework.boot");
	given(this.resolver.getArtifactId("spring-boot-starter-logging"))
			.willReturn("spring-boot-starter-logging");
	this.moduleNode.addClass(this.classNode);
	this.dependencyCustomizer = new DependencyCustomizer(
			new GroovyClassLoader(getClass().getClassLoader()), this.moduleNode,
			new DependencyResolutionContext() {

				@Override
				public ArtifactCoordinatesResolver getArtifactCoordinatesResolver() {
					return DependencyCustomizerTests.this.resolver;
				}

			});
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:20,
代码来源:DependencyCustomizerTests.java

示例2: DependencyAutoConfigurationTransformation

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
public DependencyAutoConfigurationTransformation(GroovyClassLoader loader,
		DependencyResolutionContext dependencyResolutionContext,
		Iterable<CompilerAutoConfiguration> compilerAutoConfigurations) {
	this.loader = loader;
	this.dependencyResolutionContext = dependencyResolutionContext;
	this.compilerAutoConfigurations = compilerAutoConfigurations;

}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:9,
代码来源:DependencyAutoConfigurationTransformation.java

示例3: DependencyCustomizer

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
/**
 * Create a new {@link DependencyCustomizer} instance.
 * @param loader the current classloader
 * @param moduleNode the current module
 * @param dependencyResolutionContext the context for dependency resolution
 */
public DependencyCustomizer(GroovyClassLoader loader, ModuleNode moduleNode,
		DependencyResolutionContext dependencyResolutionContext) {
	this.loader = loader;
	this.classNode = moduleNode.getClasses().get(0);
	this.dependencyResolutionContext = dependencyResolutionContext;
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:13,
代码来源:DependencyCustomizer.java

示例4: GroovyCompiler

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
/**
 * Create a new {@link GroovyCompiler} instance.
 * @param configuration the compiler configuration
 */
public GroovyCompiler(final GroovyCompilerConfiguration configuration) {

	this.configuration = configuration;
	this.loader = createLoader(configuration);

	DependencyResolutionContext resolutionContext = new DependencyResolutionContext();

	AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
			configuration.getRepositoryConfiguration(), resolutionContext);

	GrapeEngineInstaller.install(grapeEngine);

	this.loader.getConfiguration()
			.addCompilationCustomizers(new CompilerAutoConfigureCustomizer());
	if (configuration.isAutoconfigure()) {
		this.compilerAutoConfigurations = ServiceLoader
				.load(CompilerAutoConfiguration.class);
	}
	else {
		this.compilerAutoConfigurations = Collections.emptySet();
	}

	this.transformations = new ArrayList<ASTTransformation>();
	this.transformations
			.add(new DependencyManagementBomTransformation(resolutionContext));
	this.transformations.add(new DependencyAutoConfigurationTransformation(
			this.loader, resolutionContext, this.compilerAutoConfigurations));
	this.transformations.add(new GroovyBeansTransformation());
	if (this.configuration.isGuessDependencies()) {
		this.transformations.add(
				new ResolveDependencyCoordinatesTransformation(resolutionContext));
	}
	for (ASTTransformation transformation : ServiceLoader
			.load(SpringBootAstTransformation.class)) {
		this.transformations.add(transformation);
	}
	Collections.sort(this.transformations, AnnotationAwareOrderComparator.INSTANCE);
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:43,
代码来源:GroovyCompiler.java

示例5: populateClassloader

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
private URLClassLoader populateClassloader(OptionSet options)
		throws MalformedURLException {
	DependencyResolutionContext resolutionContext = new DependencyResolutionContext();

	List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
			.createDefaultRepositoryConfiguration();
	repositoryConfiguration.add(0, new RepositoryConfiguration("local",
			new File("repository").toURI(), true));

	boolean quiet = true;
	if (options.has(debugOption)) {
		System.setProperty("groovy.grape.report.downloads", "true");
		quiet = false;
	}

	AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(null,
			repositoryConfiguration, resolutionContext, quiet);

	HashMap<String, Object> dependency = new HashMap<>();
	dependency.put("group", "org.springframework.cloud.launcher");
	dependency.put("module", "spring-cloud-launcher-deployer");
	dependency.put("version", getVersion());
	dependency.put("transitive", false);
	URI[] uris = grapeEngine.resolve(null, dependency);
	URLClassLoader loader = new URLClassLoader(new URL[] { uris[0].toURL() },
			getClass().getClassLoader().getParent().getParent());
	log.debug("resolved URIs " + Arrays.asList(loader.getURLs()));
	return loader;
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-cli,
代码行数:30,
代码来源:LauncherCommand.java

示例6: DependencyManagementBomTransformation

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
public DependencyManagementBomTransformation(
		DependencyResolutionContext resolutionContext) {
	super(DEPENDENCY_MANAGEMENT_BOM_ANNOTATION_NAMES, true);
	this.resolutionContext = resolutionContext;
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:6,
代码来源:DependencyManagementBomTransformation.java

示例7: ResolveDependencyCoordinatesTransformation

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
public ResolveDependencyCoordinatesTransformation(
		DependencyResolutionContext resolutionContext) {
	super(GRAB_ANNOTATION_NAMES, false);
	this.resolutionContext = resolutionContext;
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:6,
代码来源:ResolveDependencyCoordinatesTransformation.java

示例8: DefaultAetherGrapeEngine

点赞 2

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
public DefaultAetherGrapeEngine() {
    groovyClassLoader = getGroovyClassLoader();
    grapeEngine = AetherGrapeEngineFactory.create(groovyClassLoader,
            RepositoryConfigurationFactory.createDefaultRepositoryConfiguration(),
            new DependencyResolutionContext());
}
 

开发者ID:igor-suhorukov,
项目名称:mvn-classloader,
代码行数:7,
代码来源:DefaultAetherGrapeEngine.java

示例9: getDependencyResolutionContext

点赞 1

import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext; //导入依赖的package包/类
/**
 * Returns the {@link DependencyResolutionContext}.
 * @return the dependency resolution context
 */
public DependencyResolutionContext getDependencyResolutionContext() {
	return this.dependencyResolutionContext;
}
 

开发者ID:vikrammane23,
项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,
代码行数:8,
代码来源:DependencyCustomizer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)