Gradle Maven Plugin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 17: | Line 17: | ||
{{Note|Publishing with Maven plugin has been obsoleted by [[Gradle_Maven_Publish_Plugin#Overview|maven-publish Plugin]], use that instead whenever possible.}} | {{Note|Publishing with Maven plugin has been obsoleted by [[Gradle_Maven_Publish_Plugin#Overview|maven-publish Plugin]], use that instead whenever possible.}} | ||
=Declaring an Artifact= | |||
{{External|https://docs.gradle.org/current/userguide/artifact_management.html#sec:archive_task_artifacts}} | |||
=Publishing an Artifact= | |||
{{External|https://docs.gradle.org/current/userguide/artifact_management.html#sec:publishing_artifacts}} | |||
=POM Generation= | =POM Generation= |
Revision as of 15:56, 22 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.
Publishing with Maven plugin has been obsoleted by maven-publish Plugin, use that instead whenever possible.
Declaring an Artifact
Publishing an Artifact
POM Generation
Publishing to a Maven Repository
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/")
}
}
}