Package org.apache.geronimo.kernel.repository

Examples of org.apache.geronimo.kernel.repository.Repository


        outputPath.mkdirs();
        new File(outputPath, "war").mkdir();
        File path = new File(BASEDIR, "src/test/resources/deployables/war-spaces-in-context");
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        module.setEarContext(earContext);
        module.setRootEarContext(earContext);
View Full Code Here


            }
        }
        // Step 2: check if it's in a repository
        Set<AbstractName> repos = kernel.listGBeans(new AbstractNameQuery(Repository.class.getName()));
        for (AbstractName name : repos) {
            Repository repo = getGBean(kernel, name, Repository.class);
            if(repo.contains(configId)) {
                File path = repo.getLocation(configId);
                if(!path.exists()) throw new IllegalStateException("Can't find file '"+path.getAbsolutePath()+"' though repository said there's an artifact there!");
                response.setContentType("application/zip");
                if(!reply) {
                    return true;
                }
View Full Code Here

            obr.getParentFile().mkdirs();
            Set<Artifact> artifacts = new HashSet<Artifact>();
            for (org.apache.maven.artifact.Artifact artifact: localDependencies) {
                artifacts.add(mavenToGeronimoArtifact(artifact));
            }
            Repository repo = new Maven2Repository(new File(getArtifactRepository().getBasedir()));
            GeronimoOBRGBean.generateOBR(project.getName(), artifacts, repo, obr);
        } catch (Exception e) {
            throw new MojoExecutionException("Could not construct obr repository.xml", e);
        }
    }
View Full Code Here

        //File dest = new File(BASEDIR, "target/test-resources/deployables/" + warName + "/war");
        File dest = new File(BASEDIR, "target/test-resources/deployables/" + warName);
        recursiveCopy(path, dest);
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        AbstractName jaccBeanName = kernel.getNaming().createChildName(moduleName, "foo", SecurityNames.JACC_MANAGER);
        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
View Full Code Here

            } else {
                uri = all[all.length - 1];
            }
        }
        for (int i = 0; i < repos.length; i++) {
            Repository repo = repos[i];
            if (repo.contains(uri)) {
                return repo.getLocation(uri);
            }
        }
        return null;
    }
View Full Code Here

            } else {
                uri = all[all.length - 1];
            }
        }
        for (int i = 0; i < repos.length; i++) {
            Repository repo = repos[i];
            if (repo.contains(uri)) {
                return repo.getLocation(uri);
            }
        }
        return null;
    }
View Full Code Here

        return new ConfigurationResolver(configurationId, artifactResolver, repositories, childBaseDir, configurationStore, moduleName);
    }

    public File resolve(Artifact artifact) throws MissingDependencyException {
        for (Iterator j = repositories.iterator(); j.hasNext();) {
            Repository repository = (Repository) j.next();
            if (repository.contains(artifact)) {
                File file = repository.getLocation(artifact);
                return file;
            }
        }
        throw new MissingDependencyException("Unable to resolve dependency " + artifact);
    }
View Full Code Here

    }

    private ArrayList getChildDependencies(Dependency dependency) {
        ArrayList childDependencies = new ArrayList();
        for (Iterator repositoryIterator = repositories.iterator(); repositoryIterator.hasNext();) {
            Repository repository = (Repository) repositoryIterator.next();
            if (repository.contains(dependency.getArtifact())) {
                // get the child artifacts
                LinkedHashSet childArtifacts = repository.getDependencies(dependency.getArtifact());
                for (Iterator artifactIterator = childArtifacts.iterator(); artifactIterator.hasNext();) {
                    Artifact artifact = (Artifact) artifactIterator.next();
                    // add each child as a classes-only dependency
                    childDependencies.add(new Dependency(artifact,  ImportType.CLASSES));
                }
View Full Code Here

            if (resource.isSetExternalRar()) {
                path = resource.getExternalRar().trim();
                Artifact artifact = Artifact.create(path);
                File file = null;
                for (Iterator iterator = repositories.iterator(); iterator.hasNext();) {
                    Repository repository = (Repository) iterator.next();
                    if (repository.contains(artifact)) {
                        file = repository.getLocation(artifact);
                        break;
                    }
                }
                if (file == null) {
                    throw new DeploymentException("Missing rar in repositories: " + path);
View Full Code Here

        File path = new File(BASEDIR, "src/test/resources/deployables/" + warName);
        File dest = new File(BASEDIR, "target/test-resources/deployables/" + warName + "/war");
        recursiveCopy(path, dest);
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        AbstractName jaccBeanName = kernel.getNaming().createChildName(moduleName, "foo", NameFactory.JACC_MANAGER);
        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.repository.Repository

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.