Examples of ArtifactContext


Examples of com.redhat.ceylon.cmr.api.ArtifactContext

            String version = module.getVersion();
            if (module != ModuleSpec.DEFAULT_MODULE && !module.isVersioned()) {
                version = checkModuleVersionsOrShowSuggestions(getRepositoryManager(), module.getName(), null, ModuleQuery.Type.SRC, null, null);
            }
            msg("retrieving.module", module).newline();
            ArtifactContext allArtifacts = new ArtifactContext(module.getName(), version, ArtifactContext.SRC, ArtifactContext.RESOURCES, ArtifactContext.DOCS, ArtifactContext.SCRIPTS_ZIPPED);
            List<ArtifactResult> results = getRepositoryManager().getArtifactResults(allArtifacts);
            if (results == null) {
                String err = getModuleNotFoundErrorMessage(getRepositoryManager(), module.getName(), module.getVersion());
                errorAppend(err);
                errorNewline();
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

        for (ModuleSpec module : modules) {
            if (module != ModuleSpec.DEFAULT_MODULE && !module.isVersioned()) {
                String version = checkModuleVersionsOrShowSuggestions(getRepositoryManager(), module.getName(), null, ModuleQuery.Type.ALL, null, null);
                module = new ModuleSpec(module.getName(), version);
            }
            ArtifactContext ac = new ArtifactContext(module.getName(), module.getVersion(), artifactsArray);
            ac.setIgnoreDependencies(!withDependencies);
            ac.setForceOperation(true);
            acs.add(ac);
        }
       
        // Now do the actual copying
        final boolean logArtifacts = verbose != null && (verbose.contains("all") || verbose.contains("files"));
        ModuleCopycat copier = new ModuleCopycat(getRepositoryManager(), getOutputRepositoryManager(), log, new ModuleCopycat.CopycatFeedback() {
            @Override
            public boolean beforeCopyModule(ArtifactContext ac, int count, int max) throws IOException {
                String module = ModuleUtil.makeModuleName(ac.getName(), ac.getVersion());
                msg("copying.module", module, count+1, max).flush();
                if (logArtifacts) {
                    newline().flush();
                }
                return true;
            }
            @Override
            public void afterCopyModule(ArtifactContext ac, int count, int max, boolean copied) throws IOException {
                if (!logArtifacts) {
                    append(" ").msg((copied) ? "copying.ok" : "copying.skipped").newline().flush();
                }
            }
            @Override
            public boolean beforeCopyArtifact(ArtifactContext ac, File archive, int count, int max) throws IOException {
                if (logArtifacts) {
                    append("    ").msg("copying.artifact", archive.getName(), count+1, max).flush();
                }
                return true;
            }
            @Override
            public void afterCopyArtifact(ArtifactContext ac, File archive, int count, int max, boolean copied) throws IOException {
                if (logArtifacts) {
                    append(" ").msg((copied) ? "copying.ok" : "copying.skipped").newline().flush();
                }
            }
            @Override
            public void notFound(ArtifactContext ac) throws IOException {
                String err = getModuleNotFoundErrorMessage(getRepositoryManager(), ac.getName(), ac.getVersion());
                errorAppend(err);
                errorNewline();
            }
        });
        copier.copyModules(acs);
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

    // Publish the JAR to the specified or default output repository
    public void publish() {
        RepositoryManager outputRepository = getOutputRepositoryManager();

        ArtifactContext context = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.JAR);
        context.setForceOperation(true);
        ArtifactContext descriptorContext = null;
        if (descriptor != null) {
            if (descriptor.toString().toLowerCase().endsWith(".xml")) {
                descriptorContext = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.MODULE_XML);
            } else if (descriptor.toString().toLowerCase().endsWith(".properties")) {
                descriptorContext = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.MODULE_PROPERTIES);
            }
            descriptorContext.setForceOperation(true);
        }
        try{
            File jarFile = applyCwd(this.jarFile);
            outputRepository.putArtifact(context, jarFile);
            signArtifact(context, jarFile);
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

                        } else {
                            msg("info.ok");
                        }
                    }
                } else {
                    ArtifactContext context = new ArtifactContext(name, dep.getVersion(), ArtifactContext.CAR, ArtifactContext.JAR);
                    File artifact = getRepositoryManager().getArtifact(context);
                    if (artifact != null && artifact.exists()) {
                        try {
                            Set<String> importedClasses = JarUtils.gatherClassnamesFromJar(artifact);
                            if (removeMatchingClasses(externalClasses, importedClasses)) {
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

    public void addOutputModuleToClassPath(Module module){
        RepositoryManager repositoryManager = fileManager.getOutputRepositoryManager();
        ArtifactResult artifact = null;
        try {
            ArtifactContext ctx = new ArtifactContext(module.getNameAsString(), module.getVersion(), ArtifactContext.CAR, ArtifactContext.JAR);
            artifact = repositoryManager.getArtifactResult(ctx);
        } catch (InvalidArchiveException e) {
            log.error("ceylon", "Module car " + e.getPath()
                    +" obtained from repository " + e.getRepository()
                    +" has an invalid SHA1 signature: you need to remove it and rebuild the archive, since it"
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

        }
        dir.mkdirs();

        // download a required jar
        RepositoryManager repoManager = CeylonUtils.repoManager().buildManager();
        File undertowCoreModule = repoManager.getArtifact(new ArtifactContext("io.undertow.core", "1.0.0.Beta20", ".jar"));
        File languageModule = repoManager.getArtifact(new ArtifactContext(AbstractModelLoader.CEYLON_LANGUAGE, TypeChecker.LANGUAGE_MODULE_VERSION, ".car"));

        // fire up the java compiler
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        assertNotNull("Missing Java compiler, this test is probably being run with a JRE instead of a JDK!", compiler);
        List<String> options = Arrays.asList("-sourcepath", "../ceylon-sdk/source", "-d", dir.getAbsolutePath(),
View Full Code Here

Examples of com.redhat.ceylon.cmr.api.ArtifactContext

        private TaskListener taskListener;

        public ProgressiveJar(RepositoryManager repoManager, Module module, Log log, Options options, CeyloncFileManager ceyloncFileManager, TaskListener taskListener) throws IOException{
            this.options = options;
            this.repoManager = repoManager;
            this.carContext = new ArtifactContext(module.getNameAsString(), module.getVersion(), ArtifactContext.CAR);
            this.cmrLog = new JavacLogger(options, Log.instance(ceyloncFileManager.getContext()));
            this.srcCreator = CeylonUtils.makeSourceArtifactCreator(
                    repoManager,
                    ceyloncFileManager.getLocation(StandardLocation.SOURCE_PATH),
                    module.getNameAsString(), module.getVersion(),
View Full Code Here

Examples of npanday.artifact.ArtifactContext

        if (PathUtil.getPrivateApplicationBaseFileFor(artifact, localRepository).exists())
        {
            return;
        }

        ArtifactContext artifactContext = null;
        AssemblyResolver assemblyResolver = null;
        ArtifactFactory artifactFactory = null;
        DataAccessObjectRegistry daoRegistry = null;
        try {
            artifactContext = (ArtifactContext) container.lookup(ArtifactContext.ROLE);
            assemblyResolver = (AssemblyResolver) container.lookup(AssemblyResolver.ROLE);
            artifactFactory = (ArtifactFactory) container.lookup(ArtifactFactory.ROLE);
            daoRegistry = (DataAccessObjectRegistry) container.lookup(DataAccessObjectRegistry.ROLE);

            Dependency dependency = new Dependency();
            dependency.setGroupId(artifact.getGroupId());
            dependency.setArtifactId(artifact.getArtifactId());
            dependency.setVersion(artifact.getVersion());
            dependency.setScope(Artifact.SCOPE_RUNTIME);
            dependency.setType(artifact.getType());

            try
            {
                assemblyResolver.resolveTransitivelyFor(new MavenProject(), Collections.singletonList(dependency), getMavenProject().getRemoteArtifactRepositories(),
                    localRepository, false);
            }
            catch( NPandayArtifactResolutionException e )
            {
                throw new MojoExecutionException( e.getMessage(), e );
            }

            ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
            dao.openConnection();
            Project project;

            try
            {
                project = dao.getProjectFor(dependency.getGroupId(), dependency.getArtifactId(),
                    dependency.getVersion(), dependency.getType(),
                    dependency.getClassifier());
            }
            catch( ProjectDaoException e )
            {
                 throw new MojoExecutionException( e.getMessage(), e );
            }

            List<Dependency> sourceArtifactDependencies = new ArrayList<Dependency>();
            for (ProjectDependency projectDependency : project.getProjectDependencies()) {
                sourceArtifactDependencies.add(ProjectFactory.createDependencyFrom(projectDependency));
            }
            artifactContext.getArtifactInstaller().installArtifactAndDependenciesIntoPrivateApplicationBase(localRepository, artifact,
                    sourceArtifactDependencies);
            dao.closeConnection();
        }
        catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
View Full Code Here

Examples of org.apache.maven.index.ArtifactContext

        File pom = new File( getBasedir(), "src/test/nexus-2318/aopalliance/aopalliance/1.0/aopalliance-1.0.pom" );

        ArtifactInfo artifactInfo = new ArtifactInfo( "test", "aopalliance", "aopalliance", "1.0", null );

        ArtifactContext artifactContext = new ArtifactContext( pom, artifact, null, artifactInfo, null );

        indexCreator.populateArtifactInfo( artifactContext );

        assertNotNull( "Classes should not be null", artifactContext.getArtifactInfo().classNames );
    }
View Full Code Here

Examples of org.apache.maven.index.ArtifactContext

        File pom = new File( getBasedir(), "src/test/nexus-2318/aopalliance/aopalliance/1.0/aopalliance-1.0.pom" );

        ArtifactInfo artifactInfo = new ArtifactInfo( "test", "aopalliance", "aopalliance", "1.0", null );

        ArtifactContext artifactContext = new ArtifactContext( pom, artifact, null, artifactInfo, null );

        indexCreator.populateArtifactInfo( artifactContext );

        assertNull( "Classes should be null", artifactContext.getArtifactInfo().classNames );
    }
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.