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

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


        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


  public static File getArchiveFileInCache(Ivy ivy, File cache, String organisation, String module, String revision, String artifact, String type, String ext) {
    return getArchiveFileInCache(ivy.getCacheManager(cache), organisation, module, revision, artifact, type, ext);
  }

  public static File getArchiveFileInCache(CacheManager cacheManager, String organisation, String module, String revision, String artifact, String type, String ext) {
    return cacheManager.getArchiveFileInCache(new DefaultArtifact(ModuleRevisionId.newInstance(organisation, module, revision), new Date(), artifact, type, ext));
  }
View Full Code Here

        ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), _data);
        assertNotNull(rmr);
        assertEquals(mrid, rmr.getId());
        assertEquals(2, rmr.getDescriptor().getDependencies().length);

        DefaultArtifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(), "commons-cli", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings, _cache));
        assertNotNull(report);
       
        assertEquals(1, report.getArtifactsReports().length);
       
View Full Code Here

        ModuleRevisionId mrid = ModuleRevisionId.newInstance("apache", "commons-fileupload", "1.0");
        ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), _data);
        assertNotNull(rmr);
        assertEquals(mrid, rmr.getId());

        DefaultArtifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(), "commons-fileupload", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings, _cache));
        assertNotNull(report);
       
        assertEquals(1, report.getArtifactsReports().length);
       
View Full Code Here

        dd.addIncludeRule("default", new DefaultIncludeRule(new ArtifactId(mrid.getModuleId(), "nanning-trace", "jar", "jar"), ExactPatternMatcher.INSTANCE, null));
        ResolvedModuleRevision rmr = resolver.getDependency(dd, _data);
        assertNotNull(rmr);
        assertEquals(mrid, rmr.getId());

        DefaultArtifact profiler = new DefaultArtifact(mrid, rmr.getPublicationDate(), "nanning-profiler", "jar", "jar");
        DefaultArtifact trace = new DefaultArtifact(mrid, rmr.getPublicationDate(), "nanning-trace", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {profiler, trace}, new DownloadOptions(_settings, _cache));
        assertNotNull(report);
       
        assertEquals(2, report.getArtifactsReports().length);
       
View Full Code Here

        }
        ModuleRevisionId mrid = t.transform(artifact.getModuleRevisionId());
        if (artifact.getModuleRevisionId().equals(mrid)) {
            return artifact;
        }
        return new DefaultArtifact(mrid, artifact.getPublicationDate(), artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getUrl(), artifact.getExtraAttributes());
    }
View Full Code Here

            _properties.put("project.groupId", _organisation);
            _properties.put("project.artifactId", _module);
            _properties.put("project.version", _revision);
            _properties.put("pom.version", _revision);
            _md.setModuleRevisionId(mrid);
            _md.addArtifact("master", new DefaultArtifact(mrid, getDefaultPubDate(),_module, "jar", "jar"));
            _organisation = null;
            _module = null;
            _revision = null;
        }
View Full Code Here

                moduleRevision.getAttributes());
    }
    public static String substitute(String pattern, ModuleRevisionId moduleRevision, String artifact, String type, String ext) {
        return substitute(pattern,
                moduleRevision,
                new DefaultArtifact(moduleRevision, null, artifact, type, ext),
                null);
    }
View Full Code Here

    // Called by substituteTokens only if the original artifact name is needed
    public String toString() {
      if (origin == null) {
          ModuleRevisionId revId = ModuleRevisionId.newInstance(org, moduleName, branch, revision);
          Artifact artifact = new DefaultArtifact(revId, null, artifactName, artifactType, artifactExt);
         
          CacheManager cacheManager = IvyContext.getContext().getCacheManager();
 
          origin = cacheManager.getSavedArtifactOrigin(artifact);
View Full Code Here

        Date pubdate = new GregorianCalendar(2004, 10, 1, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());
       
       
        // test to ask to download
        DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact}, getDownloadOptions(false));
        assertNotNull(report);
       
        assertEquals(1, report.getArtifactsReports().length);
       
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.