Code Monkey home page Code Monkey logo

gradle-jpi-plugin's Introduction

Gradle JPI plugin

This is a Gradle plugin for building Jenkins plugins, written in Groovy or Java.

Configuration

Add the following to your build.gradle:

buildscript {
    repositories {
        // The plugin is currently only available via the Jenkins
        // Maven repository, but has dependencies in Maven Central.
        mavenCentral()
        maven {
            url 'http://repo.jenkins-ci.org/releases/'
        }
    }
    dependencies {
        classpath 'org.jenkins-ci.tools:gradle-jpi-plugin:0.6.0'
    }
}

apply plugin: 'jpi'

group = 'org.jenkins-ci.plugins'
version = '1.2.0-SNAPSHOT'
description = 'A description of your plugin'

jenkinsPlugin {
    // version of Jenkins core this plugin depends on, must be 1.420 or later
    coreVersion = '1.420'

    // human-readable name of plugin                                               
    displayName = 'Hello World plugin built with Gradle'

    // URL for plugin on Jenkins wiki or elsewhere
    url = 'http://wiki.jenkins-ci.org/display/JENKINS/SomePluginPage'

    // plugin URL on GitHub, optional
    gitHubUrl = 'https://github.com/jenkinsci/some-plugin'              

    // use the plugin class loader before the core class loader, defaults to false
    pluginFirstClassLoader = true

    // optional list of package prefixes that your plugin doesn't want to see from core 
    maskClasses = 'groovy.grape org.apache.commons.codec'

    // optional version number from which this plugin release is configuration-compatible
    compatibleSinceVersion = '1.1.0'

    // the developers section is optional, and corresponds to the POM developers section
    developers {
        developer {
            id 'abayer'
            name 'Andrew Bayer'
            email '[email protected]'
        }
    }                           
}

Be sure to add the jenkinsPlugin { ... } section before any additional repositories are defined in your build.gradle.

Dependencies on other Jenkins Plugins

If your plugin depends on other Jenkins plugins you can specify the dependencies in the following way:

dependencies {
	jenkinsPlugins 'org.jenkinsci.plugins:git:1.1.15@jar'
	optionalJenkinsPlugins 'org.jenkins-ci.plugins:ant:1.2@jar'
	jenkinsTest 'org.jenkins-ci.main:maven-plugin:1.480@jar'
}

Adding the dependency to the jenkinsPlugins configuration will make all classes available during compilation and also add the dependency to the manifest of your plugin. To define an optional dependency on a plugin then use the optionalJenkinsPlugins configuration and to use a plugin only for testing, add a dependency to the jenkinsTest configuration.

Note that you must use the artifact only notation (append @jar if you're using the semicolon notation as in the example or specify ext: 'jar' if you're using the map-style notation).

Usage

  • gradle jpi - Build the Jenkins plugin file, which can then be found in the build directory. The file will currently end in ".hpi".
  • gradle install - Build the Jenkins plugin and install it into your local Maven repository.
  • gradle uploadArchives (or gradle deploy) - Deploy your plugin to the Jenkins Maven repository to be included in the Update Center.

Examples

Here are some real world examples of Jenkins plugins using the Gradle JPI plugin:

gradle-jpi-plugin's People

Contributors

daspilker avatar abayer avatar kohsuke avatar erdi avatar kiy0taka avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.