buildscript { repositories { mavenCentral() maven { url "https://oss.sonatype.org/content/groups/public"} } dependencies { classpath 'com.github.townsfolk:gradle-release:1.2' } } apply plugin: 'release' apply plugin: 'java' apply plugin: 'idea' sourceCompatibility = 1.6 defaultTasks 'clean', 'build' ext.rundeckPluginVersion = '1.1' configurations{ //declare custom pluginLibs configuration to include only libs for this plugin pluginLibs //declare compile to extend from pluginLibs so it inherits the dependencies compile{ extendsFrom pluginLibs } } compileJava { options.encoding = 'UTF-8' options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } repositories { mavenCentral() ivy { url = "file:$projectDir/third-party" name = 'thirdparty' layout 'pattern', { artifact "[module]-[revision]/[module]-[revision](-[classifier]).[ext]" } } } dependencies { compile group: 'org.rundeck', name: 'rundeck-core', version: '2.2.2' pluginLibs group: 'commons-beanutils', name: 'commons-beanutils', version: '1.7.0' pluginLibs group: 'dom4j', name: 'dom4j', version: '1.6.1' pluginLibs group: 'apache-log4j', name: 'apache-log4j', version: '1.2.15' pluginLibs group: 'stax', name: 'stax', version: '1.2.0' pluginLibs group: 'stax-api', name: 'stax-api', version: '1.0.1' pluginLibs group: 'org.ovirt.engine.sdk', name: 'ovirt-engine-sdk-java', version: '3.6.10.0' pluginLibs group: 'commons-httpclient', name: 'commons-httpclient', version: '3.0-rc3' } // task to copy plugin libs to output/lib dir task copyToLib(type: Copy) { into "$buildDir/output/lib" from configurations.pluginLibs } jar { //include contents of output dir from "$buildDir/output" manifest { attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true', 'Rundeck-Plugin-Libs-Load-First':'false' //create space-separated list of pluginLibs def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ') attributes 'Rundeck-Plugin-Classnames': 'ac.dynam.rundeck.plugin.resources.ovirt.oVirtResourceModelSourceFactory', 'Rundeck-Plugin-Libs': "${libList}" } } //set jar task to depend on copyToLib jar.dependsOn(copyToLib) task wrapper(type: Wrapper) { gradleVersion = '1.10' } apply plugin: 'maven' task createPom << { pom { project { groupId 'org.example' artifactId 'test' version '1.0.0' inceptionYear '2008' licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' distribution 'repo' } } } }.writeTo("pom.xml") }