Examples of Maven2Repository


Examples of org.apache.geronimo.system.repository.Maven2Repository

        }
        else if (!repositoryDirectory.isDirectory()) {
            throw new MojoExecutionException("Invalid reposiory directory: " + repositoryDirectory);
        }

        WriteableRepository repository = new Maven2Repository(repositoryDirectory);

        // Install all of the artifacts we were asked to...
        for (int i=0; i<artifacts.length; i++) {
            Artifact artifact = getArtifact(artifacts[i]);
            log.info("Installing: " + artifact);

            org.apache.geronimo.kernel.repository.Artifact gartifact = mavenArtifactToGeronimo(artifact);
            if (repository.contains(gartifact)) {
                if (force) {
                    File file = repository.getLocation(gartifact);
                    log.debug("Force deletion of: " + file);

                    if (!file.delete()) {
                        throw new MojoExecutionException("Failed to delete artifact from repository: " + artifacts[i]);
                    }
                }
                else {
                    throw new MojoExecutionException("Artifact already exists in repository: " + artifacts[i]);
                }
            }

            repository.copyToRepository(artifact.getFile(), gartifact, null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

    public void bootstrap() throws Exception {
        System.out.println("Packaging module configuration: " + plan);

        ModuleType config = ModuleDocument.Factory.parse(plan).getModule();

        Maven2Repository repository = new Maven2Repository(localRepo);
        GBeanBuilder gBeanBuilder = new GBeanBuilder(null, null);
        ServiceConfigBuilder builder = new ServiceConfigBuilder(null, Collections.singleton(repository), Collections.singleton(gBeanBuilder), new Jsr77Naming());
        ConfigurationStore targetConfigurationStore = new NullConfigurationStore() {
            public File createNewConfigurationDir(Artifact configId) throws ConfigurationAlreadyExistsException {
                return buildDir;
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

        FileUtils.forceMkdir(new File(targetServerPath));
        serverInfo = new BasicServerInfo(targetServerPath, false);
        File targetRepositoryFile = serverInfo.resolve(targetRepositoryPath);
        FileUtils.forceMkdir(targetRepositoryFile);
        writeableRepo = new Maven2Repository(targetRepositoryFile);
        configStore = new RepositoryConfigurationStore(writeableRepo);
        threadPool = null;
        asyncKeys = Collections.synchronizedMap(new HashMap<Object, DownloadResults>());
        this.serverInstanceDatas = serverInstanceDatas;
        this.persistentConfigurationLists = Collections.emptyList();
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

//        sourceRepo = new Maven2RepositoryAdapter(new File(sourceRepository.getBasedir()));
        sourceStore = new RepositoryConfigurationStore(sourceRepo);

        FileUtils.forceMkdir(targetRepositoryDirectory);

        targetRepo = new Maven2Repository(targetRepositoryDirectory);
        targetStore = new RepositoryConfigurationStore(targetRepo);

        ArtifactManager artifactManager = new DefaultArtifactManager();
        geronimoArtifactResolver = new ExplicitDefaultArtifactResolver(
                explicitResolutionProperties.getPath(),
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

        }
        else if (!repositoryDirectory.isDirectory()) {
            throw new MojoExecutionException("Invalid reposiory directory: " + repositoryDirectory);
        }

        WriteableRepository repository = new Maven2Repository(repositoryDirectory);

        // Install all of the artifacts we were asked to...
        for (int i=0; i<artifacts.length; i++) {
            Artifact artifact = getArtifact(artifacts[i]);
            log.info("Installing: " + artifact);

            org.apache.geronimo.kernel.repository.Artifact gartifact = mavenArtifactToGeronimo(artifact);
            if (repository.contains(gartifact)) {
                if (force) {
                    File file = repository.getLocation(gartifact);
                    log.debug("Force deletion of: " + file);

                    if (!file.delete()) {
                        throw new MojoExecutionException("Failed to delete artifact from repository: " + artifacts[i]);
                    }
                }
                else {
                    throw new MojoExecutionException("Artifact already exists in repository: " + artifacts[i]);
                }
            }

            repository.copyToRepository(artifact.getFile(), gartifact, null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

    public void execute() throws Exception {
        sourceRepo = new Maven1Repository(getSourceRepository());
        sourceStore = new RepositoryConfigurationStore(sourceRepo);

        targetRepo = new Maven2Repository(new File(targetRoot, targetRepository));
        targetStore = new RepositoryConfigurationStore(targetRepo);

        ArtifactManager artifactManager = new DefaultArtifactManager();
        artifactResolver = new ExplicitDefaultArtifactResolver(explicitResolutionLocation,
                artifactManager,
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

    }

    public void execute() throws MissingDependencyException, IOException {
        Artifact configId = new Artifact(groupId, artifactId, version, type);
        Repository sourceRepository = new Maven1Repository(sourceRepositoryFile);
        WriteableRepository targetRepository = new Maven2Repository(targetRepositoryFile);
        if (!sourceRepository.contains(configId)) {
            throw new MissingDependencyException("source repository at " + sourceRepositoryFile + " does not contain artifact " + configId);
        }
        if (!targetRepository.contains(configId)) {
            File sourceFile = sourceRepository.getLocation(configId);
            targetRepository.copyToRepository(sourceFile, configId, BaseConfigInstaller.LOG_COPY_START);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

        FileUtils.forceMkdir(new File(targetServerPath));
        serverInfo = new BasicServerInfo(targetServerPath, false);
        File targetRepositoryFile = serverInfo.resolve(targetRepositoryPath);
        FileUtils.forceMkdir(targetRepositoryFile);
        writeableRepo = new Maven2Repository(targetRepositoryFile);
        configStore = new RepositoryConfigurationStore(writeableRepo);
        threadPool = null;
        asyncKeys = Collections.synchronizedMap(new HashMap<Object, DownloadResults>());
        this.serverInstanceDatas = serverInstanceDatas;
        this.persistentConfigurationLists = Collections.emptyList();
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

        serverInfo = new BasicServerInfo(serverBase.getAbsolutePath(), false);
        File repoBase = new File(new File(new File(new File(new File(getBaseDir(), "src"), "test"), "resources"), "copyfiletest"), "repository");
        if (!repoBase.exists()) {
            throw new RuntimeException("Could not locate repo :" + repoBase);
        }
        Maven2Repository repo = new Maven2Repository(repoBase.toURI(), serverInfo, true);
        configStore = new RepositoryConfigurationStore(repo);
        installer = new PluginInstallerGBean(new MockConfigurationManager(),
                repo,
                configStore,
                installedPluginsList, serverInfo,
View Full Code Here

Examples of org.apache.geronimo.system.repository.Maven2Repository

        forceMkdir(new File(targetServerPath));
        serverInfo = new BasicServerInfo(targetServerPath, false, null);
        File targetRepositoryFile = serverInfo.resolve(targetRepositoryPath);
        forceMkdir(targetRepositoryFile);
        writeableRepo = new Maven2Repository(targetRepositoryFile);
        configStore = new RepositoryConfigurationStore(writeableRepo);
        threadPool = null;
        asyncKeys = new ConcurrentHashMap<Object, DownloadResults>();
        this.serverInstanceDatas = serverInstanceDatas;
        this.persistentConfigurationLists = Collections.emptyList();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.