提交 6a2dad31 编写于 作者: K Kohsuke Kawaguchi

Merged ff1f6090

Conflicts:
	changelog.html
	pom.xml
	test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
......@@ -77,6 +77,8 @@ Upcoming changes</a>
<li class=rfe>
Support self restart on Mac OS X 10.6 and onward
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-7537">issue 7537</a>)
<li class=rfe>
Added "about Jenkins" screen that shows the 3rd party license acknowledgement.
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -225,6 +225,13 @@ THE SOFTWARE.
</dependency>
</dependencies>
</plugin>
<plugin><!-- generate licenses.xml -->
<groupId>com.cloudbees</groupId>
<artifactId>maven-license-plugin</artifactId>
<configuration>
<generateLicenseXml>target/classes/META-INF/licenses.xml</generateLicenseXml>
</configuration>
</plugin>
</plugins>
</build>
......@@ -348,9 +355,9 @@ THE SOFTWARE.
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>crypto-util</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
......@@ -438,11 +445,6 @@ THE SOFTWARE.
<artifactId>localizer</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>graph-layouter</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
......@@ -685,9 +687,9 @@ THE SOFTWARE.
<version>1.14</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>memory-monitor</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.octo.captcha</groupId>
......@@ -778,17 +780,17 @@ THE SOFTWARE.
<dependency>
<groupId>net.java.sezpoz</groupId>
<artifactId>sezpoz</artifactId>
<version>1.7</version>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>jinterop-wmi</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>windows-remote-command</artifactId>
<version>1.0</version>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
......
package hudson;
import hudson.model.ManagementLink;
/**
* Show "About Jenkins" link.
*
* @author Kohsuke Kawaguchi
*/
@Extension
public class AboutJenkins extends ManagementLink {
@Override
public String getIconFileName() {
return "help.png";
}
@Override
public String getUrlName() {
return "about";
}
public String getDisplayName() {
return Messages.AboutJenkins_DisplayName();
}
@Override
public String getDescription() {
return Messages.AboutJenkins_Description();
}
}
......@@ -397,6 +397,15 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
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.
......
......@@ -28,14 +28,7 @@ import hudson.security.ACL;
import hudson.security.NotSerilizableSecurityContext;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.graph_layouter.Layout;
import org.kohsuke.graph_layouter.Navigator;
import org.kohsuke.graph_layouter.Direction;
import javax.servlet.ServletOutputStream;
import javax.imageio.ImageIO;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
......@@ -49,17 +42,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Stack;
import java.io.IOException;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.Point;
import java.awt.HeadlessException;
import java.awt.FontMetrics;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
/**
* Maintains the build dependencies between {@link AbstractProject}s
......@@ -319,97 +301,97 @@ public final class DependencyGraph implements Comparator<AbstractProject> {
return Collections.unmodifiableMap(m);
}
/**
* Experimental visualization of project dependencies.
*/
public void doGraph( StaplerRequest req, StaplerResponse rsp ) throws IOException {
// Require admin permission for now (avoid exposing project names with restricted permissions)
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
try {
// creates a dummy graphics just so that we can measure font metrics
BufferedImage emptyImage = new BufferedImage(1,1, BufferedImage.TYPE_INT_RGB );
Graphics2D graphics = emptyImage.createGraphics();
graphics.setFont(FONT);
final FontMetrics fontMetrics = graphics.getFontMetrics();
// TODO: timestamp check
Layout<AbstractProject> layout = new Layout<AbstractProject>(new Navigator<AbstractProject>() {
public Collection<AbstractProject> vertices() {
// only include projects that have some dependency
List<AbstractProject> r = new ArrayList<AbstractProject>();
for (AbstractProject p : Hudson.getInstance().getAllItems(AbstractProject.class)) {
if(!getDownstream(p).isEmpty() || !getUpstream(p).isEmpty())
r.add(p);
}
return r;
}
public Collection<AbstractProject> edge(AbstractProject p) {
return getDownstream(p);
}
public Dimension getSize(AbstractProject p) {
int w = fontMetrics.stringWidth(p.getDisplayName()) + MARGIN*2;
return new Dimension(w, fontMetrics.getHeight() + MARGIN*2);
}
}, Direction.LEFTRIGHT);
Rectangle area = layout.calcDrawingArea();
area.grow(4,4); // give it a bit of margin
BufferedImage image = new BufferedImage(area.width, area.height, BufferedImage.TYPE_INT_RGB );
Graphics2D g2 = image.createGraphics();
g2.setTransform(AffineTransform.getTranslateInstance(-area.x,-area.y));
g2.setPaint(Color.WHITE);
g2.fill(area);
g2.setFont(FONT);
g2.setPaint(Color.BLACK);
for( AbstractProject p : layout.vertices() ) {
final Point sp = center(layout.vertex(p));
for (AbstractProject q : layout.edges(p)) {
Point cur=sp;
for( Point pt : layout.edge(p,q) ) {
g2.drawLine(cur.x, cur.y, pt.x, pt.y);
cur=pt;
}
final Point ep = center(layout.vertex(q));
g2.drawLine(cur.x, cur.y, ep.x, ep.y);
}
}
int diff = fontMetrics.getAscent()+fontMetrics.getLeading()/2;
for( AbstractProject p : layout.vertices() ) {
Rectangle r = layout.vertex(p);
g2.setPaint(Color.WHITE);
g2.fillRect(r.x, r.y, r.width, r.height);
g2.setPaint(Color.BLACK);
g2.drawRect(r.x, r.y, r.width, r.height);
g2.drawString(p.getDisplayName(), r.x+MARGIN, r.y+MARGIN+ diff);
}
rsp.setContentType("image/png");
ServletOutputStream os = rsp.getOutputStream();
ImageIO.write(image, "PNG", os);
os.close();
} catch(HeadlessException e) {
// not available. send out error message
rsp.sendRedirect2(req.getContextPath()+"/images/headless.png");
}
}
private Point center(Rectangle r) {
return new Point(r.x+r.width/2,r.y+r.height/2);
}
private static final Font FONT = new Font("TimesRoman", Font.PLAIN, 10);
/**
* Margins between the project name and its bounding box.
*/
private static final int MARGIN = 4;
// /**
// * Experimental visualization of project dependencies.
// */
// public void doGraph( StaplerRequest req, StaplerResponse rsp ) throws IOException {
// // Require admin permission for now (avoid exposing project names with restricted permissions)
// Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
// try {
//
// // creates a dummy graphics just so that we can measure font metrics
// BufferedImage emptyImage = new BufferedImage(1,1, BufferedImage.TYPE_INT_RGB );
// Graphics2D graphics = emptyImage.createGraphics();
// graphics.setFont(FONT);
// final FontMetrics fontMetrics = graphics.getFontMetrics();
//
// // TODO: timestamp check
// Layout<AbstractProject> layout = new Layout<AbstractProject>(new Navigator<AbstractProject>() {
// public Collection<AbstractProject> vertices() {
// // only include projects that have some dependency
// List<AbstractProject> r = new ArrayList<AbstractProject>();
// for (AbstractProject p : Hudson.getInstance().getAllItems(AbstractProject.class)) {
// if(!getDownstream(p).isEmpty() || !getUpstream(p).isEmpty())
// r.add(p);
// }
// return r;
// }
//
// public Collection<AbstractProject> edge(AbstractProject p) {
// return getDownstream(p);
// }
//
// public Dimension getSize(AbstractProject p) {
// int w = fontMetrics.stringWidth(p.getDisplayName()) + MARGIN*2;
// return new Dimension(w, fontMetrics.getHeight() + MARGIN*2);
// }
// }, Direction.LEFTRIGHT);
//
// Rectangle area = layout.calcDrawingArea();
// area.grow(4,4); // give it a bit of margin
// BufferedImage image = new BufferedImage(area.width, area.height, BufferedImage.TYPE_INT_RGB );
// Graphics2D g2 = image.createGraphics();
// g2.setTransform(AffineTransform.getTranslateInstance(-area.x,-area.y));
// g2.setPaint(Color.WHITE);
// g2.fill(area);
// g2.setFont(FONT);
//
// g2.setPaint(Color.BLACK);
// for( AbstractProject p : layout.vertices() ) {
// final Point sp = center(layout.vertex(p));
//
// for (AbstractProject q : layout.edges(p)) {
// Point cur=sp;
// for( Point pt : layout.edge(p,q) ) {
// g2.drawLine(cur.x, cur.y, pt.x, pt.y);
// cur=pt;
// }
//
// final Point ep = center(layout.vertex(q));
// g2.drawLine(cur.x, cur.y, ep.x, ep.y);
// }
// }
//
// int diff = fontMetrics.getAscent()+fontMetrics.getLeading()/2;
//
// for( AbstractProject p : layout.vertices() ) {
// Rectangle r = layout.vertex(p);
// g2.setPaint(Color.WHITE);
// g2.fillRect(r.x, r.y, r.width, r.height);
// g2.setPaint(Color.BLACK);
// g2.drawRect(r.x, r.y, r.width, r.height);
// g2.drawString(p.getDisplayName(), r.x+MARGIN, r.y+MARGIN+ diff);
// }
//
// rsp.setContentType("image/png");
// ServletOutputStream os = rsp.getOutputStream();
// ImageIO.write(image, "PNG", os);
// os.close();
// } catch(HeadlessException e) {
// // not available. send out error message
// rsp.sendRedirect2(req.getContextPath()+"/images/headless.png");
// }
// }
//
// private Point center(Rectangle r) {
// return new Point(r.x+r.width/2,r.y+r.height/2);
// }
//
// private static final Font FONT = new Font("TimesRoman", Font.PLAIN, 10);
// /**
// * Margins between the project name and its bounding box.
// */
// private static final int MARGIN = 4;
private static final Comparator<Dependency> NAME_COMPARATOR = new Comparator<Dependency>() {
......
<!--
The MIT License
Copyright (c) 2011, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- 3rd party license acknowledgements and -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<l:layout title="${%about(app.VERSION)}">
<st:include it="${app}" page="sidepanel.jelly" />
<l:main-panel>
<h1>${%about(app.VERSION)}</h1>
<p>
${%blurb}
</p>
<p>
${%dependencies}
</p>
<t:3rdPartyLicenses>
<st:include page="/META-INF/licenses.xml" />
</t:3rdPartyLicenses>
</l:main-panel>
</l:layout>
</j:jelly>
about=About Jenkins {0}
blurb=<a href="http://jenkins-ci.org/">Jenkins</a> is a community-developed open-source continuous integration server.
dependencies=Jenkins depends on the following 3rd party libraries.
\ No newline at end of file
......@@ -50,3 +50,5 @@ Util.pastTime={0}
FilePath.TildaDoesntWork=''~'' is only supported in a Unix shell and nowhere else.
PluginManager.DisplayName=Plugin Manager
AboutJenkins.DisplayName=About Jenkins
AboutJenkins.Description=See the version and license information
......@@ -67,7 +67,9 @@ THE SOFTWARE.
</div>
</td>
<td class="center pane" style="white-space:nowrap">
${p.version}
<a href="plugin/${p.shortName}/3rdPartyLicenses">
${p.version}
</a>
</td>
<td>
<j:if test="${p.downgradable}">
......
<!--
The MIT License
Copyright (c) 2011, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- 3rd party license acknowledgements and -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<l:layout title="${%about(it.longName)}">
<l:main-panel>
<h1>${%about(it.longName+' '+it.version)}</h1>
<h3>${%3rd Party Dependencies}</h3>
<t:3rdPartyLicenses>
<j:choose>
<j:when test="${it.hasLicensesXml()}">
<j:include uri="${it.baseResourceURL}/WEB-INF/licenses.xml" />
</j:when>
<j:otherwise>
<p>${%No information recorded}</p>
</j:otherwise>
</j:choose>
</t:3rdPartyLicenses>
</l:main-panel>
</l:layout>
</j:jelly>
<!--
The MIT License
Copyright (c) 2011, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- 3rd party license acknowledgements and -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<d:taglib uri="licenses">
<d:tag name="dependencies">
<table class="pane sortable bigtable">
<tr>
<th class="pane-header">${%Name}</th>
<th class="pane-header">${%Maven ID}</th>
<th class="pane-header">${%License}</th>
</tr>
<d:invokeBody/>
</table>
</d:tag>
<d:tag name="dependency">
<tr>
<td>
<a href="${attrs.url}">${attrs.name}</a>
</td>
<td>
${attrs.groupId}:${attrs.artifactId}:${attrs.version}
</td>
<td>
<d:invokeBody />
</td>
</tr>
</d:tag>
<d:tag name="description"/>
<d:tag name="license">
<a href="${attrs.url}">${attrs.name}</a><br/>
</d:tag>
</d:taglib>
<d:invokeBody/>
</j:jelly>
/*
This script auguments 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")
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"))
}
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);
}
//
// Choose from multi-licensed modules
//==========================================================================
match("*:jna-posix") {
accept("GNU Lesser General Public License Version 2.1")
}
}
......@@ -241,7 +241,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.lib</groupId>
<artifactId>lib-jenkins-maven-artifact-manager</artifactId>
<version>1.1</version>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
......@@ -343,13 +343,20 @@ THE SOFTWARE.
<goals>
<goal>generate</goal>
</goals>
<configuration>
<configuration>
<fileMask>Messages.properties</fileMask>
<outputDirectory>target/generated-sources/localizer</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin><!-- generate licenses.xml -->
<groupId>com.cloudbees</groupId>
<artifactId>maven-license-plugin</artifactId>
<configuration>
<generateLicenseXml>target/${project.artifactId}/WEB-INF/licenses.xml</generateLicenseXml>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
......
......@@ -192,6 +192,50 @@
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>com.cloudbees</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<phase>compile</phase>
<configuration>
<!--requireCompleteLicenseInfo>true</requireCompleteLicenseInfo-->
<generateLicenseXml>target/${project.artifactId}/WEB-INF/licenses.xml</generateLicenseXml>
<inlineScript><![CDATA[
filter {
def plugins = [] as Set
// collect all Jenkins plugins
models.entrySet().each { e ->
if (e.value.packaging=="hpi")
plugins.add(e.key.id)
}
// filter out dependencies that don't belong to this plugin
models.entrySet().removeAll(models.entrySet().findAll { e ->
def a = e.key;
if (a.dependencyTrail.size()>0 && plugins.contains(a.dependencyTrail[1]))
return true; // ignore transitive dependencies through other plugins
// if the dependency goes through jenkins core, we don't need to bundle it in the war
// because jenkins-core comes in the <provided> scope, I think this is a bug in Maven that it puts such
// dependencies into the artifact list.
if (a.dependencyTrail.find { trail -> trail.contains(":hudson-core:") || trail.contains(":jenkins-core:") })
return true;
return false;
})
}
]]></inlineScript>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -162,6 +162,23 @@ THE SOFTWARE.
<artifactId>access-modifier-checker</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<groupId>com.cloudbees</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<phase>compile</phase>
<configuration>
<requireCompleteLicenseInfo>true</requireCompleteLicenseInfo>
<script>../licenseCompleter.groovy</script>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
......
......@@ -130,14 +130,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.jar.Manifest;
import java.util.logging.Filter;
import java.util.logging.Level;
......@@ -451,7 +444,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
SocketConnector connector = new SocketConnector();
connector.setHeaderBufferSize(12*1024); // use a bigger buffer as Stapler traces can get pretty large on deeply nested URL
server.setThreadPool(new ThreadPoolImpl(new ThreadPoolExecutor(1, 10, 10L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),new ThreadFactory() {
server.setThreadPool(new ThreadPoolImpl(new ThreadPoolExecutor(10, 10, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("Jetty Thread Pool");
......@@ -695,11 +688,14 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
*/
public DumbSlave createSlave(String labels, EnvVars env) throws Exception {
synchronized (hudson) {
// this synchronization block is so that we don't end up adding the same slave name more than once.
int sz = hudson.getNodes().size();
return createSlave("slave" + sz,labels,env);
}
}
DumbSlave slave = new DumbSlave("slave" + sz, "dummy",
public DumbSlave createSlave(String nodeName, String labels, EnvVars env) throws Exception {
synchronized (hudson) {
DumbSlave slave = new DumbSlave(nodeName, "dummy",
createTmpDir().getPath(), "1", Mode.NORMAL, labels==null?"":labels, createComputerLauncher(env), RetentionStrategy.NOOP, Collections.EMPTY_LIST);
hudson.addNode(slave);
return slave;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册