Skip to content

Instantly share code, notes, and snippets.

Justin Ryan quidryan

View GitHub Profile
@quidryan
quidryan / gist:5624901
Last active Dec 17, 2015
Example using NamedContainer
View gist:5624901
publications {
WAR
JAVADOC {
classifier = 'javadocs'
}
RPM
}
View gist:5624882
publications.all { ManuallyDefinedArtifact dirtyPub ->
if(!(dirtyPub.name)) {
throw new GradleException("Requires a valid name")
}
sanitizeArtifactDefinition(dirtyPub)
processPublication(dirtyPub)
}
@quidryan
quidryan / build.gradle
Last active Dec 16, 2015
Hack to get my afterEvaluation blocks to go before other ones.
View build.gradle
beforeAfterEvaluate {
println "Nah, nah, nah. I'm first"
}
@quidryan
quidryan / build.gradle
Last active Jan 30, 2020
Code to use ssh-agent when using JGit. Running in Gradle with the gradle-git plugin.
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:0.5.0' // not used in this example, but it's what brings in JGit
classpath 'com.jcraft:jsch.agentproxy.jsch:0.0.5'
classpath 'com.jcraft:jsch.agentproxy.usocket-jna:0.0.5'
classpath 'com.jcraft:jsch.agentproxy.sshagent:0.0.5'
}
@quidryan
quidryan / nebula.gradle
Created Mar 20, 2013
Netflix init.gradle to setup artifactory repos and our plugin, but being careful to not apply it.
View nebula.gradle
/**
* Establish simple Gradle practices which lets a gradle project play nice in the Netflix infrastructure.
*/
rootProject {
def nebulaDev = rootProject.hasProperty('isNebulaDev') && rootProject.isNebulaDev.toBoolean()
def nebulaVer = rootProject.hasProperty('nebulaVersion') && rootProject.nebulaVersion ? rootProject.nebulaVersion : nebulaDev?'latest.snapshot':'@nebulaVersion@'
if (nebulaDev) {
println "+==============================================================================="
@quidryan
quidryan / gist:5202284
Created Mar 20, 2013
How we boostrap the Netflix OSS project to publish internally.
View gist:5202284
/**
* Establish simple Gradle practices which let an OSS gradle project play nice in the Netflix infrastructure
*
* 1. Establish artifactory repositories as sole repositories
* 2. Add in artfactory plugin
*/
import org.apache.ivy.plugins.resolver.FileSystemResolver;
import org.apache.ivy.plugins.resolver.URLResolver;
// Jenkins workspace
@quidryan
quidryan / build.gradle
Created Feb 15, 2013
Gradle file to enforce Semantic Versioning.
View build.gradle
apply plugin: "java"
repositories {
mavenCentral()
}
dependencies {
compile "org.spockframework:spock-core:0.7-groovy-2.0"
compile "org.codehaus.groovy:groovy-all:1.8.6"
}
@quidryan
quidryan / gist:4069004
Created Nov 13, 2012
Jenkins PluginManager hidden exception
View gist:4069004
def jenkins = jenkins.model.Jenkins.instance
def clt = new jenkins.ClassLoaderReflectionToolkit();
def p = jenkins.pluginManager.activePlugins.find { it.shortName == 'job-dsl' }
def name = 'javaposse.jobdsl.plugin.SeedJobsPropertyDescriptor'
println clt.findClass(p.classLoader, name)
@quidryan
quidryan / gist:4068752
Created Nov 13, 2012
Failed to scout for extension points
View gist:4068752
Nov 13, 2012 1:27:52 PM hudson.ExtensionFinder$Sezpoz scout
WARNING: Failed to scout javaposse.jobdsl.plugin.SeedJobsPropertyDescriptor
java.lang.InstantiationException: file:/apps/builds/test-jenkins/plugins/job-dsl/WEB-INF/classes/META-INF/annotations/hudson.Extension might need to be rebuilt: java.lang.ClassNotFoundException: javaposse.jobdsl.plugin.SeedJobsPropertyDescriptor
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:644)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:283)
at hudson.ExtensionList.load(ExtensionList.java:278)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:231)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:282)
You can’t perform that action at this time.