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 publication artifacts


Any publication we define must have a unique name in our project. We can add multiple publications with their own names inside a publications configuration block. To add an artifact, we can use the artifact method in the publication definition. We can also use the artifacts property to directly set all artifacts.

We can define artifacts with the artifact method in the following ways:

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.artifacts package.

File

The information for the artifact is extracted from the filename.

Map

This is another way to define artifacts. The map must contain a source key referencing a file or archive task. The other properties we can use to further configure the artifact are classifier and extension.