Search in sources :

Example 1 with MavenDeployment

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

the class DefaultArtifactPomContainer method createDeployableFilesInfos.

public Set<MavenDeployment> createDeployableFilesInfos() {
    Set<MavenDeployment> mavenDeployments = new HashSet<MavenDeployment>();
    for (String activeArtifactPomName : artifactPoms.keySet()) {
        ArtifactPom activeArtifactPom = artifactPoms.get(activeArtifactPomName);
        File pomFile = createPomFile(activeArtifactPomName);
        PublishArtifact pomArtifact = activeArtifactPom.writePom(pomFile);
        mavenDeployments.add(new DefaultMavenDeployment(pomArtifact, activeArtifactPom.getArtifact(), activeArtifactPom.getAttachedArtifacts()));
    }
    return mavenDeployments;
}
Also used : MavenDeployment(org.gradle.api.artifacts.maven.MavenDeployment) PublishArtifact(org.gradle.api.artifacts.PublishArtifact) File(java.io.File) HashSet(java.util.HashSet)

Example 2 with MavenDeployment

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

the class AbstractMavenResolver method publish.

private void publish() {
    Set<MavenDeployment> mavenDeployments = getArtifactPomContainer().createDeployableFilesInfos();
    for (MavenDeployment mavenDeployment : mavenDeployments) {
        File pomFile = mavenDeployment.getPomArtifact().getFile();
        MavenPublishAction publishAction = createPublishAction(pomFile, mavenRepositoryLocator);
        beforeDeploymentActions.execute(mavenDeployment);
        addArtifacts(publishAction, mavenDeployment);
        execute(publishAction);
    }
}
Also used : MavenDeployment(org.gradle.api.artifacts.maven.MavenDeployment) File(java.io.File) MavenPublishAction(org.gradle.api.publication.maven.internal.action.MavenPublishAction)

Aggregations

File (java.io.File)2 MavenDeployment (org.gradle.api.artifacts.maven.MavenDeployment)2 HashSet (java.util.HashSet)1 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)1 MavenPublishAction (org.gradle.api.publication.maven.internal.action.MavenPublishAction)1