How can I use already existing Plugins in my own Custom Plugin?


(Michael Hoff) #1

How can I use already existing Plugins in my own Custom Plugin?

I wanted to use the " apply plugin: ‘artifactory’ " from JFrog and turn it into my own Plugin, that will just require a String for the Group ID and a String for the Version Number to upload it into our repository. Basically I have a working build.gradle file but I was wondering if I could simplify it even more and just write a plugin, that executes the tasks, that my build script does.

Thanks again for answering my previous question in the old forum!


(Merlyn Albery-Speyer) #2

Hi Mike,

You could try making a script with all of your typical settings, and then use apply from: “myartifactorydefaults.gradle” and then go on to customize the configuration in your build script. If this works for you, you can go on to host the script so that it’s accessible via http. That goes some way towards making it portable, e.g.: apply from: “http://host/.../myartifactorydefaults.gradle.

Cheers, Merlyn


(Michael Hoff) #3

Thank you very much I’ll give it a try!