Java 类org.springframework.boot.cli.compiler.RepositoryConfigurationFactory 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RunCommand.java   
@Override
protected synchronized ExitStatus run(OptionSet options) throws Exception {
    synchronized (this.monitor) {
        if (this.runner != null) {
            throw new RuntimeException(
                    "Already running. Please stop the current application before running another (use the 'stop' command).");
        }

        SourceOptions sourceOptions = new SourceOptions(options);

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

        SpringApplicationRunnerConfiguration configuration = new SpringApplicationRunnerConfigurationAdapter(
                options, this, repositoryConfiguration);

        this.runner = new SpringApplicationRunner(configuration,
                sourceOptions.getSourcesArray(), sourceOptions.getArgsArray());
        this.runner.compileAndRun();

        return ExitStatus.OK;
    }
}
项目:spring-boot-concourse    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:spring-boot-concourse    文件:RunCommand.java   
@Override
protected synchronized ExitStatus run(OptionSet options) throws Exception {

    if (this.runner != null) {
        throw new RuntimeException(
                "Already running. Please stop the current application before running another (use the 'stop' command).");
    }

    SourceOptions sourceOptions = new SourceOptions(options);

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

    SpringApplicationRunnerConfiguration configuration = new SpringApplicationRunnerConfigurationAdapter(
            options, this, repositoryConfiguration);

    this.runner = new SpringApplicationRunner(configuration,
            sourceOptions.getSourcesArray(), sourceOptions.getArgsArray());
    this.runner.compileAndRun();

    return ExitStatus.OK;
}
项目:contestparser    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:contestparser    文件:RunCommand.java   
@Override
protected synchronized ExitStatus run(OptionSet options) throws Exception {

    if (this.runner != null) {
        throw new RuntimeException(
                "Already running. Please stop the current application before running another (use the 'stop' command).");
    }

    SourceOptions sourceOptions = new SourceOptions(options);

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

    SpringApplicationRunnerConfiguration configuration = new SpringApplicationRunnerConfigurationAdapter(
            options, this, repositoryConfiguration);

    this.runner = new SpringApplicationRunner(configuration,
            sourceOptions.getSourcesArray(), sourceOptions.getArgsArray());
    this.runner.compileAndRun();

    return ExitStatus.OK;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:spring-boot-concourse    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:spring-boot-concourse    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:spring-boot-concourse    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:contestparser    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:contestparser    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:contestparser    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:spring-cloud-cli    文件:LauncherCommand.java   
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;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:OptionSetGroovyCompilerConfiguration.java   
protected OptionSetGroovyCompilerConfiguration(OptionSet optionSet,
        CompilerOptionHandler compilerOptionHandler) {
    this(optionSet, compilerOptionHandler,
            RepositoryConfigurationFactory.createDefaultRepositoryConfiguration());
}
项目:spring-boot-concourse    文件:OptionSetGroovyCompilerConfiguration.java   
protected OptionSetGroovyCompilerConfiguration(OptionSet optionSet,
        CompilerOptionHandler compilerOptionHandler) {
    this(optionSet, compilerOptionHandler,
            RepositoryConfigurationFactory.createDefaultRepositoryConfiguration());
}
项目:contestparser    文件:OptionSetGroovyCompilerConfiguration.java   
protected OptionSetGroovyCompilerConfiguration(OptionSet optionSet,
        CompilerOptionHandler compilerOptionHandler) {
    this(optionSet, compilerOptionHandler,
            RepositoryConfigurationFactory.createDefaultRepositoryConfiguration());
}
项目:mvn-classloader    文件:AetherEngine.java   
public static void install(GroovyClassLoader classLoader) {
    install(classLoader, new DependencyResolutionContext(), RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration());
}
项目:mvn-classloader    文件:DefaultAetherGrapeEngine.java   
public DefaultAetherGrapeEngine() {
    groovyClassLoader = getGroovyClassLoader();
    grapeEngine = AetherGrapeEngineFactory.create(groovyClassLoader,
            RepositoryConfigurationFactory.createDefaultRepositoryConfiguration(),
            new DependencyResolutionContext());
}