Package org.apache.ivy

Examples of org.apache.ivy.Ivy.install()


        ModuleRevisionId mrid = ModuleRevisionId
                .newInstance(organisation, module, branch, revision);

        ResolveReport report;
        try {
            report = ivy.install(
                mrid,
                from,
                to,
                new InstallOptions().setTransitive(transitive).setValidate(doValidate(settings))
                        .setOverwrite(overwrite).setConfs(conf.split(","))
View Full Code Here


    public void testSimple() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"), ivy.getSettings()
                .getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.2/ivy-2.0.xml").exists());
        assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
    }
View Full Code Here

    public void testValidate() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("orgfailure", "modfailure", "1.0"), ivy
                .getSettings().getDefaultResolver().getName(), "install", new InstallOptions());

        assertFalse(new File("build/test/install/orgfailure/modfailure/ivy-1.0.xml").exists());
        assertFalse(new File("build/test/install/orgfailure/modfailure/modfailure-1.0.jar")
                .exists());
View Full Code Here

    public void testMaven() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ResolveReport rr = ivy.install(ModuleRevisionId.newInstance("org.apache", "test", "1.0"),
            ivy.getSettings().getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org.apache/test/ivy-1.0.xml").exists());
        assertTrue(new File("build/test/install/org.apache/test/test-1.0.jar").exists());
View Full Code Here

        assertTrue(new File("build/test/install/org.apache/test/test-1.0.jar").exists());

        // the original descriptor is not installed
        assertFalse(new File("build/test/install/org.apache/test/test-1.0.pom").exists());

        ivy.install(ModuleRevisionId.newInstance("org.apache", "test", "1.0"), ivy.getSettings()
                .getDefaultResolver().getName(), "install", new InstallOptions()
                .setInstallOriginalMetadata(true).setOverwrite(true));

        // the original descriptor is installed now, too
        assertTrue(new File("build/test/install/org.apache/test/test-1.0.pom").exists());
View Full Code Here

    public void testNoValidate() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("orgfailure", "modfailure", "1.0"), ivy
                .getSettings().getDefaultResolver().getName(), "install",
            new InstallOptions().setValidate(false));

        assertTrue(new File("build/test/install/orgfailure/modfailure/ivy-1.0.xml").exists());
        assertTrue(new File("build/test/install/orgfailure/modfailure/modfailure-1.0.jar").exists());
View Full Code Here

    public void testSimpleWithoutDefaultResolver() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings-nodefaultresolver.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"), "test", "install",
            new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.2/ivy-2.0.xml").exists());
        assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
    }
View Full Code Here

    public void testDependencies() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), ivy.getSettings()
                .getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.1/ivy-1.0.xml").exists());
        assertTrue(new File("build/test/install/org1/mod1.1/mod1.1-1.0.jar").exists());
View Full Code Here

    public void testLatestDependenciesNoDefaultResolver() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings-nodefaultresolver.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.4", "1.0.1"), "test", "install",
            new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.4/ivy-1.0.1.xml").exists());

        assertTrue(new File("build/test/install/org1/mod1.1/ivy-2.0.xml").exists());
View Full Code Here

    public void testLatestDependenciesDummyDefaultResolver() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings-dummydefaultresolver.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.4", "1.0.1"), "test", "install",
            new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.4/ivy-1.0.1.xml").exists());

        assertTrue(new File("build/test/install/org1/mod1.1/ivy-2.0.xml").exists());
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.