Package: org.gradle.api.publish.maven

## [Java] Interface MavenArtifactSet

- org.gradle.api.DomainObjectSet

- All Superinterfaces:
    Iterable, DomainObjectCollection, Collection, 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.create("name", MavenPublication)
       def artifacts = publication.artifacts

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

  See Also:
    DomainObjectSet

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `MavenArtifact` | `artifact(Object source)` Creates and adds a MavenArtifact to the set.
    `MavenArtifact` | `artifact(Object source, Action<? super MavenArtifact> config)` Creates and adds a MavenArtifact to the set, which is configured by the associated action.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface DomainObjectSet` | `findAll, matching, matching, withType`
    `interface DomainObjectCollection` | `all, all, findAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType, withType`
    `interface Set` | `add, equals, hashCode, clear, contains, isEmpty, size, toArray, toArray, addAll, iterator, remove, containsAll, removeAll, retainAll`

- - ### Method Detail

    - #### public MavenArtifact artifact(Object source)

      Creates and adds a MavenArtifact to the set. The semantics of this method are the same as MavenPublication.artifact.

      Parameters:
        `source` - The source of the artifact content.

    - #### public 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.

      Parameters:
        `source` - The source of the artifact.
        `config` - An action or closure to configure the values of the constructed MavenArtifact.