Package org.gradle.api.artifacts.maven

Examples of org.gradle.api.artifacts.maven.MavenPom


    public MavenPom addFilter(String name, PublishFilter publishFilter) {
        if (name == null || publishFilter == null) {
            throw new InvalidUserDataException("Name and Filter must not be null.");
        }
        MavenPom pom = mavenPomFactory.create();
        pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
        return pom;
    }
View Full Code Here


    }


    @Test
    public void addFilter() {
        MavenPom pom = pomFilterContainer.addFilter(TEST_NAME, publishFilterMock);
        assertSame(pom, pomMock);
        assertSame(pomMock, pomFilterContainer.pom(TEST_NAME));
        assertSame(publishFilterMock, pomFilterContainer.filter(TEST_NAME));
    }
View Full Code Here

        return new DefaultArtifact(ModuleRevisionId.newInstance("org", name, "1.0"), null, name, type, type, extraAttributes);
    }

    @Test
    public void writePom() {
        final MavenPom mavenPomMock = context.mock(MavenPom.class);
        DefaultArtifactPom artifactPom = new DefaultArtifactPom(mavenPomMock);
        final File somePomFile = new File(tmpDir.getDir(), "someDir/somePath");
        context.checking(new Expectations() {{
            allowing(mavenPomMock).getArtifactId();
            will(returnValue("artifactId"));
View Full Code Here

        return new DefaultArtifact(IvyUtil.createModuleRevisionId("org", name, "1.0"), null, name, type, type, extraAttributes);
    }

    @Test
    public void writePom() {
        final MavenPom mavenPomMock = context.mock(MavenPom.class);
        DefaultArtifactPom artifactPom = new DefaultArtifactPom(mavenPomMock);
        final File somePomFile = new File(tmpDir.getTestDirectory(), "someDir/somePath");
        context.checking(new Expectations() {{
            allowing(mavenPomMock).getArtifactId();
            will(returnValue("artifactId"));
View Full Code Here

                }

                ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
                ModuleInternal module = configuration.getModule();
                for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
                    MavenPom pom = resolver.getPom();
                    ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
                            pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(),
                            pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
                            pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
                    );
                    publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
                }
            }
        });
View Full Code Here

    }


    @Test
    public void addFilter() {
        MavenPom pom = pomFilterContainer.addFilter(TEST_NAME, publishFilterMock);
        assertSame(pom, pomMock);
        assertSame(pomMock, pomFilterContainer.pom(TEST_NAME));
        assertSame(publishFilterMock, pomFilterContainer.filter(TEST_NAME));
    }
View Full Code Here

     */
    public MavenPom pom(Closure configureClosure) {
        Factory<MavenPom> pomFactory = mavenFactory.createMavenPomFactory(project.getConfigurations(),
                conf2ScopeMappings.getMappings(),
                project.getFileResolver());
        MavenPom pom = pomFactory.create();
        pom.setGroupId(project.getGroup().toString());
        pom.setArtifactId(project.getName());
        pom.setVersion(project.getVersion().toString());
        return ConfigureUtil.configure(configureClosure, pom);
    }
View Full Code Here

    public MavenPom addFilter(String name, PublishFilter publishFilter) {
        if (name == null || publishFilter == null) {
            throw new InvalidUserDataException("Name and Filter must not be null.");
        }
        MavenPom pom = mavenPomFactory.create();
        pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
        return pom;
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.artifacts.maven.MavenPom

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.