Package org.apache.ivy.core.module.descriptor

Examples of org.apache.ivy.core.module.descriptor.DefaultArtifact


        testLocateThenDownload(engine,
            DefaultArtifact.newIvyArtifact(ModuleRevisionId.parse("org1#mod1.1;1.0"), new Date()),
            new File("test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml"));
        testLocateThenDownload(engine,
            new DefaultArtifact(ModuleRevisionId.parse("org1#mod1.1;1.0"), new Date(), "mod1.1",
                    "jar", "jar"), new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"));
    }
View Full Code Here


    private Path getMetaArtifactPath(ArtifactDownloadReport adr, String metaType,
            String metaClassifier) {
        Artifact artifact = adr.getArtifact();
        Map extraAtt = new HashMap(artifact.getExtraAttributes());
        extraAtt.put("classifier", metaClassifier);
        Artifact metaArtifact = new DefaultArtifact(artifact.getModuleRevisionId(), artifact
                .getPublicationDate(), artifact.getName(), metaType, "jar", extraAtt);
        RepositoryCacheManager cache = ivy.getSettings()
                .getResolver(artifact.getModuleRevisionId()).getRepositoryCacheManager();
        if (cache instanceof DefaultRepositoryCacheManager) {
            File metaArtifactFile = ((DefaultRepositoryCacheManager) cache)
View Full Code Here

        return new ArtifactOrigin(
            DefaultArtifact.newIvyArtifact(mrid, null), false, getIvyFileInCache(mrid).getPath());
    }
   
    private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) {
        return new DefaultArtifact(mrid, new Date(), "metadata", "metadata", "ivy", true);
    }
View Full Code Here

        if ("pom".equals(packaging)) {
            // no artifact defined! Add the default artifact if it exist.
            DependencyResolver resolver = parserSettings.getResolver(mrid);
           
            if (resolver != null) {
                DefaultArtifact artifact = new DefaultArtifact(
                                    mrid, new Date(), artifactId, "jar", "jar");
                ArtifactOrigin artifactOrigin = resolver.locate(artifact);
               
                if (!ArtifactOrigin.isUnknown(artifactOrigin)) {
                    mainArtifact = artifact;
                    ivyModuleDescriptor.addArtifact("master", mainArtifact);
                }
            }

            return;
        } else if (JAR_PACKAGINGS.contains(packaging)) {
            ext = "jar";
        } else {
            ext = packaging;
        }

        mainArtifact = new DefaultArtifact(mrid, new Date(), artifactId, packaging, ext);
        ivyModuleDescriptor.addArtifact("master", mainArtifact);
    }
View Full Code Here

            getResolveOptions(new String[] {"*"}));
        assertNotNull(report);
        assertFalse(report.hasError());
       
        // dependencies
        DefaultArtifact depArtifact =
            TestHelper.newArtifact("org1", "mod1.1", "1.0", "mod1.1", "jar", "jar");
        ModuleRevisionId depMrid = ModuleRevisionId.newInstance("org1", "mod1.1", "1.0");
        DefaultRepositoryCacheManager cacheMgr1 =
            (DefaultRepositoryCacheManager)ivy.getSettings().getDefaultRepositoryCacheManager();
        DefaultRepositoryCacheManager cacheMgr2 =
View Full Code Here

        }
    }

    private Artifact getArtifact(String org, String module, String rev, String artName,
            String type, String ext) {
        return new DefaultArtifact(ModuleRevisionId.newInstance(org, module, rev), new Date(),
                artName, type, ext);
    }
View Full Code Here

   
    private File getArchiveFileInCache(Ivy ivy, String organisation, String module, String branch, String revision,
            String artifactName, String type, String ext, Map extraAttrs) {
        ModuleRevisionId mrid = ModuleRevisionId.newInstance(organisation, module,
            branch, revision);
        DefaultArtifact artifact = new DefaultArtifact(mrid, new Date(), artifactName, type, ext, extraAttrs);
        return TestHelper.getRepositoryCacheManager(ivy, mrid).getArchiveFileInCache(artifact);
    }
View Full Code Here

                        }
                        String status = attributes.getValue("status");
                        String artifactName = attributes.getValue("name");
                        String type = attributes.getValue("type");
                        String ext = attributes.getValue("ext");
                        Artifact artifact = new DefaultArtifact(mrid, pubdate, artifactName,
                                type, ext, ExtendableItemHelper.getExtraAttributes(attributes,
                                    "extra-"));
                        ArtifactDownloadReport aReport = new ArtifactDownloadReport(artifact);
                        aReport.setDownloadStatus(DownloadStatus.fromString(status));
                        aReport.setDownloadDetails(attributes.getValue("details"));
View Full Code Here

     }


    public void addArtifact(String artifactId, String packaging) {
        ivyModuleDescriptor.addArtifact("master",
                new DefaultArtifact(mrid, new Date(), artifactId, packaging, packaging));
    }
View Full Code Here

        // anything else than original token
        return new ArtifactOrigin(false, getIvyFileInCache(mrid).getPath());
    }
   
    private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) {
        return new DefaultArtifact(mrid, new Date(), "metadata", "metadata", "ivy", true);
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.descriptor.DefaultArtifact

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.