Gradle Artifact Publishing Concepts: Difference between revisions
Line 15: | Line 15: | ||
Publishing plugins, such as [[Gradle_Maven_Plugin#Overview|Maven]] and [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish]], define [[Gradle_Maven_Plugin#Publishing_to_a_Maven_Repository|publishing tasks]], which then can be configured in build scripts and used to publish artifacts. | Publishing plugins, such as [[Gradle_Maven_Plugin#Overview|Maven]] and [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish]], define [[Gradle_Maven_Plugin#Publishing_to_a_Maven_Repository|publishing tasks]], which then can be configured in build scripts and used to publish artifacts. | ||
<font color=darkgray>Is the following relevant to [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish]], or only to [[Gradle_Maven_Plugin#Overview|Maven]]?<span id='Configuration'></span><span id='Dependency_Configuration'></span>The [[Gradle_Dependencies_and_Dependency_Configurations#Dependency_Configuration|Gradle '''dependency configurations''']] are also used to specify publishing artifacts. There are two configurations introduced by the [[Gradle_Java_Plugin#Overview|Java plugin]] that are relevant to artifact generation and publishing: [[Gradle_Java_Plugin#archives|archives]] and [[Gradle_Java_Plugin#runtime|runtime]]. Their relationship with artifact publishing is explained in the [[Gradle_Java_Plugin#Overview|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. | <font color=darkgray>Is the following relevant to [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish]], or only to [[Gradle_Maven_Plugin#Overview|Maven]]?</font><span id='Configuration'></span><span id='Dependency_Configuration'></span>The [[Gradle_Dependencies_and_Dependency_Configurations#Dependency_Configuration|Gradle '''dependency configurations''']] are also used to specify publishing artifacts. There are two configurations introduced by the [[Gradle_Java_Plugin#Overview|Java plugin]] that are relevant to artifact generation and publishing: [[Gradle_Java_Plugin#archives|archives]] and [[Gradle_Java_Plugin#runtime|runtime]]. Their relationship with artifact publishing is explained in the [[Gradle_Java_Plugin#Overview|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= | =Artifact= |
Revision as of 15:55, 22 May 2018
External
- https://docs.gradle.org/current/userguide/artifact_management.html
- https://docs.gradle.org/current/userguide/publishing_maven.html
- https://docs.gradle.org/current/userguide/maven_plugin.html#uploading_to_maven_repositories
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
Publishing plugin allow it to be configured.
Classifier
Publishing plugin allow it to be configured.
Declaring an Artifact
Publishing an Artifact
Publishing to a Maven Repository
- Gradle 1.3 and newer: Publishing to a Maven Repository with maven-publish Plugin
- Pre-Gradle 1.3 Way: Publishing to a Maven Repository with Maven Plugin