Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for JENKINS-13165 #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
The MIT License

Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Andrew Bayer
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Andrew Bayer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,27 +24,26 @@ THE SOFTWARE.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.350</version>
<relativePath>../pom.xml</relativePath>
<version>1.463</version><!-- which version of Jenkins is this plugin built against? -->
</parent>

<artifactId>clone-workspace-scm</artifactId>
<packaging>hpi</packaging>
<name>Jenkins Clone Workspace SCM Plug-in</name>
<version>0.5-SNAPSHOT</version>
<version>0.5-SNAPSHOT-ronny</version>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Clone+Workspace+SCM+Plugin</url>
<description>Plugin to archive workspaces from one project and reuse those as SCM sources for other projects.</description>

<licenses>
<license>
<name>MIT license</name>
<comments>All source code is under the MIT license.</comments>
</license>
</licenses>


<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -109,5 +108,5 @@ THE SOFTWARE.
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListene
}
// This means we found something.
if((includeMsg==null) && (excludeMsg==null)) {
DirScanner globScanner = new DirScanner.Glob(realIncludeGlob, realExcludeGlob);
// See https://issues.jenkins-ci.org/browse/JENKINS-13165 re: Ant 1.8.2+ excluding SCM files by default.
// Don't use any defaults from Ant, and always let user specify (realExcludeGlob)
// WARNING: this assumes Jenkins 1.463 at least.
boolean useDefaultExcludes = false;
DirScanner globScanner = new DirScanner.Glob(realIncludeGlob, realExcludeGlob, useDefaultExcludes);
build.addAction(snapshot(build, ws, globScanner, listener, archiveMethod));

// Find the next most recent build meeting this criteria with an archived snapshot.
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/workspaceExcludeGlob.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<p>Specify the files to exclude from the archive of the build's workspace,
using wildcards and separators like '**/.svn/**/*, .git/**/*'.
See <a href='http://ant.apache.org/manual/CoreTypes/fileset.html'>
See <a href='http://ant.apache.org/manual/Types/fileset.html'>
the @includes of Ant fileset</a> for the exact format.
The base directory is <a href='ws/'>the workspace</a>.</p>
</div>
4 changes: 2 additions & 2 deletions src/main/webapp/workspaceGlob.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<p>Specify the files to include in the archive of the build's workspace,
using wildcards like 'module/dist/**/*.zip'.
See <a href='http://ant.apache.org/manual/CoreTypes/fileset.html'>
See <a href='http://ant.apache.org/manual/Types/fileset.html'>
the @includes of Ant fileset</a> for the exact format.
The base directory is <a href='ws/'>the workspace</a>.</p>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

import hudson.model.FreeStyleProject;
import hudson.model.FreeStyleBuild;
import hudson.model.Label;
import hudson.model.Result;
import hudson.model.User;
import hudson.model.labels.LabelAtom;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;

Expand Down Expand Up @@ -62,12 +62,12 @@ public void testBasicCloning() throws Exception {

public void testSlaveCloning() throws Exception {
FreeStyleProject parentJob = createCloneParentProject();
parentJob.setAssignedLabel(createSlave(new Label("parentSlave")).getSelfLabel());
parentJob.setAssignedLabel(createSlave(new LabelAtom("parentSlave")).getSelfLabel());

buildAndAssertSuccess(parentJob);

FreeStyleProject childJob = createCloneChildProject();
childJob.setAssignedLabel(createSlave(new Label("childSlave")).getSelfLabel());
childJob.setAssignedLabel(createSlave(new LabelAtom("childSlave")).getSelfLabel());
buildAndAssertSuccess(childJob);

FreeStyleBuild fb = childJob.getLastBuild();
Expand Down