Package com.cloudbees.sdk.maven

Examples of com.cloudbees.sdk.maven.ResolvedDependenciesCache


    private Injector injector;
    private RepositoryService rs;

    private void run(String[] args) throws Exception {
        ResolvedDependenciesCache cache = new ResolvedDependenciesCache() {
            private RepositoryService getRepositoryService() {
                if (injector==null)
                    injector = Guice.createInjector(
                            new RepositorySystemModule(),
                            new AbstractModule() {
                                @Override
                                protected void configure() {
                                    bind(RemoteRepositoryDecorator.class).toInstance(new RemoteRepositoryDecoratorImpl());
                                }
                            });
                if (rs==null)
                    rs = injector.getInstance(RepositoryService.class);
                return rs;
            }

            @Override
            protected File getCacheDir() {
                return Launcher.getLocalRepository();
            }

            @Override
            protected DependencyResult forceResolve(GAV gav) throws DependencyResolutionException {
                RepositoryService rs = getRepositoryService();
                return rs.resolveDependencies(gav);
            }

            @Override
            protected File resolveArtifact(Artifact a) throws ArtifactResolutionException {
                return getRepositoryService().resolveArtifact(a).getArtifact().getFile();
            }
        };

        List<File> jars= cache.resolve(new GAV("com.cloudbees.sdk", "bees-driver", "LATEST"));

        File tools = findToolsJar();
        if (tools != nulljars.add(tools);

        // we don't let this classloader delegate to the 2nd stage boot classloader
View Full Code Here

TOP

Related Classes of com.cloudbees.sdk.maven.ResolvedDependenciesCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.