Search in sources :

Example 1 with MavenPom

use of org.gradle.api.artifacts.maven.MavenPom in project gradle by gradle.

the class BasePomFilterContainer method addFilter.

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;
}
Also used : InvalidUserDataException(org.gradle.api.InvalidUserDataException) MavenPom(org.gradle.api.artifacts.maven.MavenPom)

Example 2 with MavenPom

use of org.gradle.api.artifacts.maven.MavenPom in project gradle by gradle.

the class MavenPluginConvention method pom.

/**
 * Creates a new {@link MavenPom}.
 *
 * @return The POM instance.
 */
public MavenPom pom() {
    MavenPom pom = createMavenPom();
    pom.setGroupId(project.getGroup().toString());
    pom.setArtifactId(project.getName());
    pom.setVersion(project.getVersion().toString());
    return pom;
}
Also used : MavenPom(org.gradle.api.artifacts.maven.MavenPom)

Example 3 with MavenPom

use of org.gradle.api.artifacts.maven.MavenPom in project gradle by gradle.

the class BasePomFilterContainer method pom.

@Override
public MavenPom pom(String name, Action<? super MavenPom> configureAction) {
    MavenPom pom = pom(name);
    configureAction.execute(pom);
    return pom;
}
Also used : MavenPom(org.gradle.api.artifacts.maven.MavenPom)

Example 4 with MavenPom

use of org.gradle.api.artifacts.maven.MavenPom in project gradle by gradle.

the class BasePomFilterContainer method pom.

@Override
public MavenPom pom(Action<? super MavenPom> configureAction) {
    MavenPom pom = getPom();
    configureAction.execute(pom);
    return pom;
}
Also used : MavenPom(org.gradle.api.artifacts.maven.MavenPom)

Example 5 with MavenPom

use of org.gradle.api.artifacts.maven.MavenPom in project gradle by gradle.

the class BasePomFilterContainerTest method addFilter.

@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));
}
Also used : MavenPom(org.gradle.api.artifacts.maven.MavenPom) Test(org.junit.Test)

Aggregations

MavenPom (org.gradle.api.artifacts.maven.MavenPom)8 Test (org.junit.Test)2 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)1 DefaultMavenPom (org.gradle.api.publication.maven.internal.pom.DefaultMavenPom)1 Expectations (org.jmock.Expectations)1