Do not load detached plugins during tests (#2829)

* Do not load detached plugins during tests.
Also warn about plugins which force us to create classes.jar.

* Porting POM fix from #2795: we must allow snapshots from repo.jenkins-ci.org so as to be able to test upstream component PRs.

* Fixed failures in tests which assumed detached plugins were being loaded.

* jenkins-test-harness 2.20

* Unreproducible test failure on CI, probably due to timing.
This commit is contained in:
Jesse Glick authored and Oleg Nenashev committed 2017-05-01 16:44:55 +03:00
1 parent c33e7dc420
commit 0993b7099b
11 files changed
+35 -32

No files matched your search

@@ -194,8 +194,10 @@ public class ClassicPluginStrategy implements PluginStrategy {
baseResourceURL = resolve(archive,atts.getValue("Resource-Path")).toURI().toURL();
} else {
File classes = new File(expandDir, "WEB-INF/classes");
if (classes.exists())
if (classes.exists()) { // should not normally happen, due to createClassJarFromWebInfClasses
LOGGER.log(Level.WARNING, "Deprecated unpacked classes directory found in {0}", classes);
paths.add(classes);
}
File lib = new File(expandDir, "WEB-INF/lib");
File[] libs = lib.listFiles(JAR_FILTER);
if (libs != null)
@@ -669,6 +671,9 @@ public class ClassicPluginStrategy implements PluginStrategy {
z.add(mapper);
z.execute();
}
if (classesJar.isFile()) {
LOGGER.log(Level.WARNING, "Created {0}; update plugin to a version created with a newer harness", classesJar);
}
}
private static void unzipExceptClasses(File archive, File destDir, Project prj) {