Package org.apache.ivy.plugins.resolver.packager

Examples of org.apache.ivy.plugins.resolver.packager.PackagerResolver


        try {
            // set the locale to UK as workaround for SUN bug 6240963
            Locale.setDefault(Locale.UK);

            // Create and configure resolver
            PackagerResolver resolver = new PackagerResolver();
            resolver.setSettings(settings);
            File repoRoot = new File("test/repositories/IVY-1179/repo");
            resolver.addIvyPattern(
                    new File(repoRoot, "[organisation]/[module]/[revision]/ivy.xml").getAbsoluteFile().toURL().toExternalForm());
            resolver.setPackagerPattern(
                    new File(repoRoot, "[organisation]/[module]/[revision]/packager.xml").getAbsoluteFile().toURL().toExternalForm());
            resolver.setBuildRoot(builddir);
            resolver.setResourceCache(cachedir);
            resolver.setPreserveBuildDirectories(true);
            resolver.setVerbose(true);
           
            resolver.setProperty("packager.website.url",
                new File("test/repositories/IVY-1179/website").getAbsoluteFile().toURL().toExternalForm());
   
            resolver.setName("packager");
   
            // Get module descriptor
            ModuleRevisionId mrid = ModuleRevisionId.newInstance("org", "B", "1.0");
            ResolvedModuleRevision rmr = resolver.getDependency(
              new DefaultDependencyDescriptor(mrid, false), data);
   
            // Download artifact
            Artifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(), "B", "jar", "jar");
            resolver.download(new Artifact[] {artifact}, downloadOptions());
           
            // assert that the file B.jar is extracted from the archive
            File jar = new File(builddir, "org/B/1.0/artifacts/jars/B.jar");
            assertTrue(jar.exists());
           
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.resolver.packager.PackagerResolver

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.