MavenArtifactSet

API Documentation:MavenArtifactSet

A Collection of MavenArtifacts to be included in a MavenPublication. Being a DomainObjectSet, a MavenArtifactSet provides convenient methods for querying, filtering, and applying actions to the set of MavenArtifacts.

apply plugin: 'maven-publish'

def publication = publishing.publications.create("name", MavenPublication)
def artifacts = publication.artifacts

artifacts.matching({
    it.classifier == "classy"
}).all({
    it.extension = "ext"
})

Properties

No properties

Methods

MethodDescription
artifact(source)

Creates and adds a MavenArtifact to the set. The semantics of this method are the same as MavenPublication.artifact(java.lang.Object).

artifact(source, config)

Creates and adds a MavenArtifact to the set, which is configured by the associated action. The semantics of this method are the same as MavenPublication.artifact(java.lang.Object, org.gradle.api.Action).

Script blocks

No script blocks

Method details

MavenArtifact artifact(Object source)

Creates and adds a MavenArtifact to the set. The semantics of this method are the same as MavenPublication.artifact(java.lang.Object).

MavenArtifact artifact(Object source, Action<? super MavenArtifact> config)

Creates and adds a MavenArtifact to the set, which is configured by the associated action. The semantics of this method are the same as MavenPublication.artifact(java.lang.Object, org.gradle.api.Action).