Gradle Maven Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 17: Line 17:


Additionally to installing artifacts into the local Maven cache (repository), the plugin can upload to remote Maven repositories.
Additionally to installing artifacts into the local Maven cache (repository), the plugin can upload to remote Maven repositories.
=POM Generation=
{{External|https://docs.gradle.org/current/userguide/maven_plugin.html#sec:maven_pom_generation}}


=Publishing to a Maven Repository=
=Publishing to a Maven Repository=

Revision as of 19:34, 15 May 2018

External

Internal

Overview

apply plugin: 'maven'

The Maven plugin define an "install" task of type "Upload". It installs the associated artifacts to the local Maven cache, including the Maven metadata. By default, the task is associated with the "archives" configuration.

Additionally to installing artifacts into the local Maven cache (repository), the plugin can upload to remote Maven repositories.

POM Generation

https://docs.gradle.org/current/userguide/maven_plugin.html#sec:maven_pom_generation

Publishing to a Maven Repository

https://docs.gradle.org/current/userguide/maven_plugin.html#uploading_to_maven_repositories

Gradle can be configured to publish artifacts to a Maven repository by configuring Maven plugin's uploadArchive task In build.gradle:

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "file://localhost/tmp/myRepo/")
        }
    }
}