diff --git a/core/pom.xml b/core/pom.xml index af385810fa548575afa0ca9d6141c0af182f1ccc..a7ea2914f75ff945125ec416d4f51242b0b6dc3e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -225,6 +225,13 @@ THE SOFTWARE. + + com.cloudbees + maven-license-plugin + + target/classes/META-INF/licenses.xml + + diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 55e038bb93f6fc797f736b9d2f330857421727cb..168edc426b5a295ce72dca845110b5525348ea20 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -397,6 +397,15 @@ public class PluginWrapper implements Comparable { return manifest.getMainAttributes().getValue("Plugin-Class"); } + public boolean hasLicensesXml() { + try { + new URL(baseResourceURL,"WEB-INF/licenses.xml").openStream().close(); + return true; + } catch (IOException e) { + return false; + } + } + /** * Makes sure that all the dependencies exist, and then accept optional dependencies * as real dependencies. diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index 877fc301375d70e2923d8ba4b2cea2ae5aa619b3..1cf0928d7a34e47f0b3e647f63dd78215058f23f 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -67,7 +67,9 @@ THE SOFTWARE. - ${p.version} + + ${p.version} + diff --git a/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.jelly b/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.jelly new file mode 100644 index 0000000000000000000000000000000000000000..1c6e4fa397c44729b296742d417a4e03b783aada --- /dev/null +++ b/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.jelly @@ -0,0 +1,44 @@ + + + + + + +

${%about(it.longName+' '+it.version)}

+ +

${%3rd Party Dependencies}

+ + + + + + +

${%No information recorded}

+
+
+
+
+
+
diff --git a/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.properties b/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.properties new file mode 100644 index 0000000000000000000000000000000000000000..d01c4dc5008206511c0bf06c33166c715dddac4f --- /dev/null +++ b/core/src/main/resources/hudson/PluginWrapper/3rdPartyLicenses.properties @@ -0,0 +1 @@ +about=About {0} \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/Hudson/about.jelly b/core/src/main/resources/hudson/model/Hudson/about.jelly new file mode 100644 index 0000000000000000000000000000000000000000..4e374b7d16a25e8cc8e5d54230f233b701c589ee --- /dev/null +++ b/core/src/main/resources/hudson/model/Hudson/about.jelly @@ -0,0 +1,43 @@ + + + + + + + +

${%about(it.VERSION)}

+

+ ${%blurb} +

+ +

+ ${%dependencies} +

+ + + +
+
+
diff --git a/core/src/main/resources/hudson/model/Hudson/about.properties b/core/src/main/resources/hudson/model/Hudson/about.properties new file mode 100644 index 0000000000000000000000000000000000000000..4f677ba18dee32be015a28daa452f6c4be5cb84c --- /dev/null +++ b/core/src/main/resources/hudson/model/Hudson/about.properties @@ -0,0 +1,4 @@ +about=About Jenkins {0} +blurb=Jenkins is a community-developed open-source continuous integration server. + +dependencies=Jenkins depends on the following 3rd party libraries. \ No newline at end of file diff --git a/core/src/main/resources/lib/hudson/3rdPartyLicenses.jelly b/core/src/main/resources/lib/hudson/3rdPartyLicenses.jelly new file mode 100644 index 0000000000000000000000000000000000000000..42799241602fa70c32056ca7211f3c1ee7ea682d --- /dev/null +++ b/core/src/main/resources/lib/hudson/3rdPartyLicenses.jelly @@ -0,0 +1,57 @@ + + + + + + + + + + + + + +
${%Name}${%Maven ID}${%License}
+
+ + + + ${attrs.name} + + + ${attrs.groupId}:${attrs.artifactId}:${attrs.version} + + + + + + + + + ${attrs.name}
+
+
+ +
diff --git a/licenseCompleter.groovy b/licenseCompleter.groovy new file mode 100644 index 0000000000000000000000000000000000000000..252f005e1a2ab631b1e1b0fd7687c50258c06fe7 --- /dev/null +++ b/licenseCompleter.groovy @@ -0,0 +1,92 @@ + +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") +def jenkinsLicense = license("MIT License","http://jenkins-ci.org/mit-license") + + +match("asm:*") { + 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","org.jvnet.hudson:commons-jelly","org.jvnet.hudson:commons-jelly-tags-define","slide:slide-webdavlib"]) { + rewriteLicense([], apacheLicense) +} + +// GlassFish components are dual-licensed between CDDL and GPL+Classpath Exception +// we elect to take them under CDDL. +match(["javax.mail:*","org.jvnet.hudson:activation","org.jvnet:tiger-types","javax.servlet:jstl"]) { + rewriteLicense([], cddl) +} + +match("antlr:*") { + rewriteLicense([], license("BSD License","http://www.antlr.org/license.html")) +} + +match("jaxen:jaxen") { + rewriteLicense([], license("BSD License","http://jaxen.codehaus.org/license.html")) +} + +match("args4j:args4j") { + rewriteLicense([], mitLicense) +} + +match("*:dom4j") { + rewriteLicense([],license("BSD License","http://dom4j.sourceforge.net/dom4j-1.6.1/license.html")) +} + +match(["org.codehaus.groovy:*"]) { + // see http://groovy.codehaus.org/License+Information + // see http://jmdns.sourceforge.net/license.html + rewriteLicense([],apacheLicense) +} + +match("*:stapler-adjunct-timeline") { + rewriteLicense([],license("BSD License","http://simile.mit.edu/license.html")) +} + +match("*:txw2") { + // see http://java.net/projects/jaxb/sources/version2/content/trunk/txw2/license.txt?rev=3611 + rewriteLicense([],cddl) +} + +match(["org.kohsuke.jinterop:j-interop","org.kohsuke.jinterop:j-interopdeps"]) { + rewriteLicense([],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(["org.jenkins-ci.modules:instance-identity","org.jvnet.hudson:task-reactor","org.jvnet.hudson:annotation-indexer","*:jinterop-wmi","*:maven2.1-interceptor","*:hudson-maven-embedder"]) { + rewriteLicense([],jenkinsLicense) +} + +match("*:jna") { + rewriteLicense([],lgpl) +} + +match(["org.jvnet.localizer:localizer","*:trilead-putty-extension"]) { + // see http://java.net/projects/localizer + // see http://java.net/projects/trilead-putty-extension/ + rewriteLicense([],mitLicense); +} + +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")) +} + + + +// +// Choose from multi-licensed modules +//========================================================================== + +match("*:jna-posix") { + accept("GNU Lesser General Public License Version 2.1") +} diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index b597d8c4a8452d747f07e23e557de529ff267ff2..ca0e8e533095178c569423109a288822eec284f4 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -193,7 +193,7 @@ THE SOFTWARE. org.jenkins-ci.lib lib-jenkins-maven-artifact-manager - 1.1 + 1.2 commons-io @@ -288,13 +288,20 @@ THE SOFTWARE. generate - + Messages.properties target/generated-sources/localizer + + com.cloudbees + maven-license-plugin + + target/${project.artifactId}/WEB-INF/licenses.xml + + org.jvnet.maven-antrun-extended-plugin maven-antrun-extended-plugin diff --git a/pom.xml b/pom.xml index 1021d4667a55fe94be27b8bb647233d37ef70741..e5c85545b657602a2058e07d77bd527bdd377b3d 100644 --- a/pom.xml +++ b/pom.xml @@ -161,6 +161,23 @@ THE SOFTWARE. + + com.cloudbees + maven-license-plugin + 1.0 + + + + process + + compile + + true + ../licenseCompleter.groovy + + + +