Jitpack.io: Can I deploy a gradle plugin on jitpack?

Created on 9 Jun 2017  路  11Comments  路  Source: jitpack/jitpack.io

I have a simple gradle plugin,
Can I deploy a gradle plugin on jitpack?

Most helpful comment

Same question. It is annoying for me to wait for gradle to manually approve my plugin.

All 11 comments

Can I deploy a gradle plugin on jitpack?

You can, but IMHO it doesn't make much sense, since Gradle plug-ins are supposed to be hosted on https://plugins.gradle.org/

Bringing this back, but do you have an example somewhere? Hosting plugins for jitpack is definitely useful if you'd like to keep everything inline with other dependencies. With one push, you'll be able to use the commit versions, assuming that is how it works.

Same question. I am working on a plugin that I don't want to publish yet but I want to test it already...

Same question. It is annoying for me to wait for gradle to manually approve my plugin.

Hi, any news on this?

Let the code explain:

apply plugin: 'java'
apply plugin: 'plugin-id'

buildscript() {
    repositories {
        maven {
            url 'https://jitpack.io'
        }
    }
    dependencies {
        classpath 'com.github.User:Repo:Version'
    }
}

Example:

apply plugin: 'java'
apply plugin: 'jamplate'

buildscript() {
    repositories {
        maven {
            url 'https://jitpack.io'
        }
    }
    dependencies {
                //replace 'TAG' with the desired version
        classpath 'com.github.cufyorg:jamplate-gradle-plugin:TAG'
    }
}

Awesome, let me try

@LSafer

Did you try to make this work with the new plugins { } dsl?

@elect86 yes I did. But, it was a long time for me to remember the conclusion. I think it is not possible. But, It might work by playing around with plugin repositories.

@elect86 see the plugin I published https://github.com/cufyorg/jamplate-gradle-plugin for latest updates of my approaches to deliver it.

Gotcha!

build.gradle.kts:

plugins {
    ...
    id("com.github.elect86.docs") version "5335fdf4"
}

settings.gradle.kts:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if(requested.id.toString() == "com.github.elect86.docs")
                useModule("com.github.elect86:docs:5335fdf4")
        }
    }
    repositories {
        gradlePluginPortal()
        maven("https://jitpack.io")
    }
}

And make sure to set the id plugin as the annotation:

gradlePlugin {
    // Define the plugin
    val greeting by plugins.creating {
        id = "com.github.elect86.docs"
        implementationClass = "docs.DocsPlugin"
    }
}

And you are good to rock!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

afollestad picture afollestad  路  5Comments

jitpack-io picture jitpack-io  路  4Comments

jitpack-io picture jitpack-io  路  5Comments

Hala-Nearmotion picture Hala-Nearmotion  路  4Comments

SilenceDut picture SilenceDut  路  4Comments