jenkins/licenseCompleter.groovy

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
3.7 KiB
Groovy
Raw Normal View History

/*
Spelling fixes in changelogs, Javadoc, logs and UI (#2718) * spelling: abstract * spelling: about * spelling: absolute * spelling: across * spelling: activity * spelling: actually * spelling: addition * spelling: allocating * spelling: ambiguous * spelling: analyzes * spelling: analysis * spelling: another * spelling: appear * spelling: arbitrary * spelling: artifact * spelling: assignment * spelling: associated * spelling: augment * spelling: authentication * spelling: automatically * spelling: available * spelling: availability * spelling: because * spelling: background * spelling: beginning * spelling: boolean * spelling: browsers * spelling: building * spelling: calculation * spelling: channel * spelling: column * spelling: concatenation * spelling: connect * spelling: contribute * spelling: convert * spelling: copied * spelling: couldn't * spelling: scrambled * spelling: creates-a * spelling: curr-entry * spelling: customize * spelling: diagnostic * spelling: contain * spelling: default * spelling: delimiter * spelling: descriptor * spelling: disambiguates * spelling: different * spelling: diligently * spelling: disabled * spelling: discovered * spelling: display * spelling: doesn't * spelling: dollar * spelling: downstream * spelling: dynamically * spelling: preemptively * spelling: encrypt * spelling: erroneous * spelling: examine * spelling: existence * spelling: value * spelling: february * spelling: handling * spelling: hostname * spelling: convenient * spelling: identify * spelling: implementation * spelling: incorrect * spelling: individual * spelling: initialization * spelling: initialized * spelling: inputstream * spelling: instantiated * spelling: instantiation * spelling: intended * spelling: interpreted * spelling: interrupted * spelling: invocations * spelling: kern * spelling: localization * spelling: logger * spelling: malfunctioning * spelling: methods * spelling: monitor * spelling: mutator * spelling: multiple * spelling: object * spelling: configured * spelling: optionally * spelling: option * spelling: overridden * spelling: parameterized * spelling: parent * spelling: permissions * spelling: plugin * spelling: potentially * spelling: preferable * spelling: problems like * spelling: programmatically * spelling: property * spelling: reallocate * spelling: recommended * spelling: redirected * spelling: registered * spelling: reliable * spelling: remember * spelling: recurrence * spelling: repeatable * spelling: repeated * spelling: resource * spelling: retrieve * spelling: returned * spelling: revision * spelling: sandwich * spelling: separator * spelling: serialization * spelling: settings * spelling: shadow * spelling: should * spelling: someone * spelling: source * spelling: specified * spelling: style * spelling: subversion * spelling: sufficient * spelling: supplementary * spelling: suppressing * spelling: synchronization * spelling: synchronized * spelling: this * spelling: transitioning * spelling: termination * spelling: trying * spelling: truncatable * spelling: unknown * spelling: undeployed * spelling: unnecessary * spelling: unparseable * spelling: update * spelling: upper * spelling: verify * spelling: visible * spelling: warning * spelling: we're * spelling: whitespace * spelling: wide * spelling: with * spelling: workspace * spelling: yielding * spelling: to * spelling: by * spelling: the * spelling: hours
2017-02-12 18:38:30 +08:00
This script augments the missing license information in our dependencies.
*/
complete {
// license constants
def apacheLicense = license("The Apache Software License, Version 2.0","http://www.apache.org/licenses/LICENSE-2.0.txt")
def cddl = license("CDDL","http://www.sun.com/cddl/")
def lgpl = license("LGPL 2.1","http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html")
def mitLicense = license("MIT License","http://www.opensource.org/licenses/mit-license.php")
2012-12-30 01:54:14 +08:00
def bsdLicense = license("BSD License","http://opensource.org/licenses/BSD-2-Clause")
def jenkinsLicense = license("MIT License","https://www.jenkins.io/mit-license")
def ccby = license("Creative Commons Attribution License","http://creativecommons.org/licenses/by/2.5")
match("asm:*") {
if (dependency.licenses.isEmpty())
rewriteLicense([], license("BSD License","http://asm.ow2.org/license.html"))
}
// Apache components
// logkit is a part of Avalon
match(["org.apache.ant:*","commons-jelly:*","log4j:*","avalon-framework:*","logkit:logkit","oro:oro","commons-codec:*","commons-beanutils:*","commons-net:*","commons-cli:*","*:commons-jelly","org.jvnet.hudson:commons-jelly-tags-define","slide:slide-webdavlib"]) {
2011-04-20 22:46:04 +08:00
if (dependency.licenses.isEmpty())
rewriteLicense([], apacheLicense)
}
// GlassFish components are dual-licensed between CDDL and GPL+Classpath Exception
// we elect to take them under CDDL.
// note that central has a different POM from m.g.o-public (http://repo2.maven.org/maven2/javax/mail/mail/1.4/mail-1.4.pom
// vs http://maven.glassfish.org/content/groups/public/javax/mail/mail/1.4/mail-1.4.pom), so we aren't using rewriteLicense here
2012-12-30 01:54:14 +08:00
match(["javax.mail:*","org.jvnet.hudson:activation","org.jvnet:tiger-types","javax.servlet:jstl","javax.xml.stream:stax-api"]) {
if (dependency.licenses.isEmpty())
dependency.licenses=[cddl]
}
2013-07-30 01:56:04 +08:00
/* TODO
2013-07-30 01:56:04 +08:00
// according to JSR-250 1.0-20050927.133100 POM, it came from JAX-WS, which is under CDDL.
match("javax.annotation:jsr250-api") {
rewriteLicense([], cddl)
}
*/
match("org.jenkins-ci.dom4j:dom4j") {
rewriteLicense([],license("BSD License","http://dom4j.sourceforge.net/dom4j-1.6.1/license.html"))
}
[GROOVY-4292] Update Groovy to 1.8.9 to avoid random livelock during startup when init.groovy specified. "GroovyInitScript.init" daemon prio=10 tid=0x00007f28d0001800 nid=0x48 runnable [0x00007f28cb79e000] java.lang.Thread.State: RUNNABLE at java.util.WeakHashMap.get(Unknown Source) at org.codehaus.groovy.ast.ClassHelper.makeCached(ClassHelper.java:121) at org.codehaus.groovy.ast.ClassHelper.makeWithoutCaching(ClassHelper.java:183) at org.codehaus.groovy.ast.ClassHelper.make(ClassHelper.java:170) at org.codehaus.groovy.ast.ClassHelper.make(ClassHelper.java:159) at org.codehaus.groovy.vmplugin.v5.Java5.makeClassNode(Java5.java:382) at org.codehaus.groovy.vmplugin.v5.Java5.makeParameter(Java5.java:403) at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:396) at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:331) at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:262) - locked <0x00000000f4bfe2b0> (a java.lang.Object) at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:356) at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:946) at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:926) at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:916) at org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:1070) at org.codehaus.groovy.classgen.AsmClassGenerator.visitPropertyExpression(AsmClassGenerator.java:1027) at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55) at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateEqual(BinaryExpressionHelper.java:287) at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:76) at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:519) at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49) at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:599) at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:354) at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:501) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:80) at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:155) at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:447) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112) at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:312) at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:269) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123) at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:389) at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50) at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:173) at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:767) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:967) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:546) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:524) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:501) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:578) at hudson.init.impl.GroovyInitScript.execute(GroovyInitScript.java:83) at hudson.init.impl.GroovyInitScript.execute(GroovyInitScript.java:78) at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.init.InitializerFinder.invoke(InitializerFinder.java:120) at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at jenkins.model.Jenkins$7.runTask(Jenkins.java:889) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
2013-08-16 01:27:28 +08:00
match(["org.jenkins-ci.groovy:*"]) {
2021-09-07 15:09:42 +08:00
// see https://groovy-lang.org/faq.html
// see http://jmdns.sourceforge.net/license.html
rewriteLicense([],apacheLicense)
}
2012-12-30 01:54:14 +08:00
match("relaxngDatatype:relaxngDatatype") {
// see http://sourceforge.net/projects/relaxng/
rewriteLicense([],bsdLicense)
}
match(["org.kohsuke.jinterop:j-interop","org.kohsuke.jinterop:j-interopdeps"]) {
rewriteLicense([license("MIT license", "http://www.opensource.org/licenses/mit-license.php")],license("LGPL v3","http://www.j-interop.org/license.html"))
}
// these are our own modules that have license in the trunk but not in these released versions
// as we upgrade them, we should just pick up the license info from POM
match(["*:maven2.1-interceptor","*:lib-jenkins-maven-embedder"]) {
rewriteLicense([],jenkinsLicense)
}
match("org.codehaus.plexus:plexus-interactivity-api") {
rewriteLicense([],mitLicense)
}
match("de.zeigermann.xml:xml-im-exporter:1.1") {
rewriteLicense([],license("BSD License","http://xml-im-exporter.cvs.sourceforge.net/viewvc/xml-im-exporter/xml-im-exporter/Copying.txt?revision=1.3&view=markup"))
}
match("*:sezpoz") {
// GPL-phobia people react to "GPL" strongly, so accept sezpoz under CDDL
rewriteLicense([license("CDDL or GPL 2 with Classpath Exception",null)],cddl)
}
match("net.jcip:jcip-annotations") {
rewriteLicense([],ccby)
}
}