org.gradle.api.publish.maven
[Java] Interface MavenArtifactSet
org.gradle.api.DomainObjectCollection
org.gradle.api.publish.maven.MavenArtifactSet
java.util.Collection
org.gradle.api.DomainObjectSet
java.lang.Iterable
- All Superinterfaces:
- DomainObjectCollection, Collection, DomainObjectSet, Iterable
@Incubating
public interface MavenArtifactSet
extends DomainObjectSet
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.add("name", MavenPublication)
def artifacts = publication.artifacts
artifacts.matching({
it.classifier == "classy"
}).all({
it.extension = "ext"
})
- See Also:
- DomainObjectSet
Methods inherited from interface DomainObjectCollection
|
all, all, findAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType, withType |
Methods inherited from interface Set
|
add, remove, equals, hashCode, clear, isEmpty, contains, size, toArray, toArray, iterator, spliterator, addAll, containsAll, removeAll, retainAll, stream, removeIf, parallelStream, forEach |
artifact
public MavenArtifact artifact(Object source)
- Creates and adds a MavenArtifact to the set.
The semantics of this method are the same as MavenPublication#artifact(Object)#artifact(Object).
- Parameters:
source
- The source of the artifact content.
artifact
public MavenArtifact artifact(Object source, Action 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(Object, Action)#artifact(Object, Action).
- Parameters:
source
- The source of the artifact.config
- An action or closure to configure the values of the constructed MavenArtifact.
Gradle API 1.5