gradle
8.4

# getArtifacts

abstract fun getArtifacts(): IvyArtifactSet(source)

The complete set of artifacts for this publication.

Setting this property will clear any previously added artifacts and create artifacts from the specified sources. Each supplied source is interpreted as per artifact. For example, to exclude the dependencies declared by a component and instead use a custom set of artifacts:

    plugins {
        id 'java'
        id 'ivy-publish'
    }

    task sourceJar(type: Jar) {
      archiveClassifier = "source"
    }

    publishing {
      publications {
        ivy(IvyPublication) {
          from components.java
          artifacts = ["my-custom-jar.jar", sourceJar]
        }
      }
    }

Content copied to clipboard

#### Return

the artifacts.