Book Image

Gradle Dependency Management

By : Hubert Klein Ikkink
Book Image

Gradle Dependency Management

By: Hubert Klein Ikkink

Overview of this book

Table of Contents (14 chapters)
Gradle Dependency Management
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Defining artifacts


In the previous section, you learned that the Java plugin adds an archives configuration that is used to group artifacts from the project. Just as we created configurations for dependencies in our project, we can also create our own configurations for its artifacts. To assign an archive or file to this configuration, we must use the artifacts configuration block in our build script. Inside the configuration closure, we use the name of the configuration followed by the artifact. We can also further customize the artifact definition inside the artifacts block.

We can define artifacts with the following three types:

Type

Description

AbstractArchiveTask

The information for the artifact is extracted from the archive task. The artifact is an instance of PublishArtifact in the org.gradle.api.artifact s package.

File

The information for the artifact is extracted from the filename. The artifact is an instance of ConfigurablePublishArtifact that extends PublishArtifact.

...