Gradle Artifact Publishing Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 39: Line 39:
==Publishing with Maven Publish in Gradle 1.3 and Newer==
==Publishing with Maven Publish in Gradle 1.3 and Newer==


{{Internal|Gradle_Maven_Publish_Plugin#Publishing_to_a_Maven_Repository|Publishing to a Maven Repository with maven-publish Plugin}}
{{Internal|Gradle_Maven_Publish_Plugin#Publishing_to_a_Maven_Repository|Publishing to a Maven Repository with Maven Publish Plugin}}


==Publishing with Maven Before Gradle 1.3==
==Publishing with Maven Before Gradle 1.3==


{{Internal|Gradle_Maven_Plugin#Publishing_to_a_Maven_Repository|Publishing to a Maven Repository with Maven Plugin}}
{{Internal|Gradle_Maven_Plugin#Publishing_to_a_Maven_Repository|Publishing to a Maven Repository with Maven Plugin}}

Revision as of 16:00, 22 May 2018

External

Internal

Overview

Publishing plugins, such as Maven and Maven Publish, define publishing tasks, which then can be configured in build scripts and used to publish artifacts.

Is the following relevant to Maven Publish, or only to Maven? The Gradle dependency configurations are also used to specify publishing artifacts. There are two configurations introduced by the Java plugin that are relevant to artifact generation and publishing: archives and runtime. Their relationship with artifact publishing is explained in the Java plugin page. Any custom archive created as part of the build are not automatically assigned to any configuration. If such as assignment is desired, it will have to be explicitly declared.

Artifact

Projects use Gradle to produce artifacts, also referred to as publication artifacts. Artifacts of a project are the files the project provides to the outside world. In most cases, these files are pushed to a repository.

Extension

Maven 'extension'

Publishing plugin allow it to be configured.

Classifier

Maven 'classifier'

Publishing plugin allow it to be configured.

Publishing to a Maven Repository

There are two plugins that can be used to publish to a Maven repository: Maven and Maven Publish. Gradle 1.3 and newer makes Maven Publish available. For pre-1.3 Gradle, only Maven can be used to publish.

Publishing with Maven Publish in Gradle 1.3 and Newer

Publishing to a Maven Repository with Maven Publish Plugin

Publishing with Maven Before Gradle 1.3

Publishing to a Maven Repository with Maven Plugin