licenseCompleter.groovy 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * This script augments the missing license information in our dependencies.
  3. */
  4. complete {
  5. // license constants
  6. def apacheLicense = license("The Apache Software License, Version 2.0", "http://www.apache.org/licenses/LICENSE-2.0.txt")
  7. def cddl = license("CDDL", "http://www.sun.com/cddl/")
  8. def lgpl = license("LGPL 2.1", "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html")
  9. def mitLicense = license("MIT License", "http://www.opensource.org/licenses/mit-license.php")
  10. def bsdLicense = license("BSD License", "http://opensource.org/licenses/BSD-2-Clause")
  11. def jenkinsLicense = license("MIT License", "https://www.jenkins.io/mit-license")
  12. def ccby = license("Creative Commons Attribution License", "http://creativecommons.org/licenses/by/2.5")
  13. match("asm:*") {
  14. if (dependency.licenses.isEmpty())
  15. rewriteLicense([], license("BSD License", "http://asm.ow2.org/license.html"))
  16. }
  17. // Apache components
  18. // logkit is a part of Avalon
  19. match([
  20. "org.apache.ant:*",
  21. "log4j:*",
  22. "avalon-framework:*",
  23. "logkit:logkit",
  24. "oro:oro",
  25. "commons-codec:*",
  26. "commons-beanutils:*",
  27. "commons-net:*",
  28. "commons-cli:*",
  29. "org.jenkins-ci:commons-jelly",
  30. "org.jenkins-ci:commons-jelly-tags-fmt",
  31. "org.jenkins-ci:commons-jelly-tags-xml",
  32. "org.jvnet.hudson:commons-jelly-tags-define",
  33. "slide:slide-webdavlib"
  34. ]) {
  35. if (dependency.licenses.isEmpty())
  36. rewriteLicense([], apacheLicense)
  37. }
  38. // GlassFish components are dual-licensed between CDDL and GPL+Classpath Exception
  39. // we elect to take them under CDDL.
  40. // 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
  41. // vs http://maven.glassfish.org/content/groups/public/javax/mail/mail/1.4/mail-1.4.pom), so we aren't using rewriteLicense here
  42. match([
  43. "javax.mail:*",
  44. "org.jvnet.hudson:activation",
  45. "org.jvnet:tiger-types",
  46. "javax.servlet:jstl",
  47. "javax.xml.stream:stax-api"
  48. ]) {
  49. if (dependency.licenses.isEmpty())
  50. dependency.licenses=[cddl]
  51. }
  52. /* TODO
  53. // according to JSR-250 1.0-20050927.133100 POM, it came from JAX-WS, which is under CDDL.
  54. match("javax.annotation:jsr250-api") {
  55. rewriteLicense([], cddl)
  56. }
  57. */
  58. match("org.jenkins-ci.dom4j:dom4j") {
  59. rewriteLicense([], license("BSD License", "http://dom4j.sourceforge.net/dom4j-1.6.1/license.html"))
  60. }
  61. match(["org.jenkins-ci.groovy:*"]) {
  62. // see https://groovy-lang.org/faq.html
  63. // see http://jmdns.sourceforge.net/license.html
  64. rewriteLicense([], apacheLicense)
  65. }
  66. match("relaxngDatatype:relaxngDatatype") {
  67. // see http://sourceforge.net/projects/relaxng/
  68. rewriteLicense([], bsdLicense)
  69. }
  70. match(["org.kohsuke.jinterop:j-interop", "org.kohsuke.jinterop:j-interopdeps"]) {
  71. rewriteLicense([license("MIT license", "http://www.opensource.org/licenses/mit-license.php")], license("LGPL v3", "http://www.j-interop.org/license.html"))
  72. }
  73. // these are our own modules that have license in the trunk but not in these released versions
  74. // as we upgrade them, we should just pick up the license info from POM
  75. match(["*:maven2.1-interceptor", "*:lib-jenkins-maven-embedder"]) {
  76. rewriteLicense([], jenkinsLicense)
  77. }
  78. match("org.codehaus.plexus:plexus-interactivity-api") {
  79. rewriteLicense([], mitLicense)
  80. }
  81. match("de.zeigermann.xml:xml-im-exporter:1.1") {
  82. 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"))
  83. }
  84. match("*:sezpoz") {
  85. // GPL-phobia people react to "GPL" strongly, so accept sezpoz under CDDL
  86. rewriteLicense([license("CDDL or GPL 2 with Classpath Exception", null)], cddl)
  87. }
  88. match("net.jcip:jcip-annotations") {
  89. rewriteLicense([], ccby)
  90. }
  91. }