Skip to content

Instantly share code, notes, and snippets.

@tomdcc
Created Sep 22, 2015
Embed
What would you like to do?
Example for publishing a Gradle plugin to the plugin portal while downloading it from somewhere else
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
}
}
apply plugin: "com.gradle.plugin-publish"
repositories {
// your private repo here
maven { url "https://plugins.gradle.org/m2/" }
}
// download our custom jar from a repo
configurations {
downloaded
}
dependencies {
// path to the artifact in your private repo
downloaded "gradle.plugin.test.foobar:example-plugin:1.7"
}
// clear out defaults from java plugin
configurations.archives.artifacts.clear()
artifacts {
// add downloaded jar to the archives configuration set of artifacts
archives configurations.downloaded.resolve()[0]
}
group = 'org.examples'
version = '2.0'
pluginBundle {
plugins {
website = 'http://foo.com/'
description = 'Downloaded plugin'
vcsUrl = 'https://github.com/foo/bar'
tags = ['downloaded']
downloadedPlugin {
id = 'org.samples.examples.helloworld'
displayName = 'Downloaded Plugin'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment