Skip to content
Permalink
Browse files

[JENKINS-51062] Extend ClassFilterImpl.isLocationWhitelisted Maven-or…

…iented exclusions to plugin under test during Gradle builds.
  • Loading branch information
jglick committed May 3, 2018
1 parent 3fb17fb commit b14ba46a141b21d5f45679d2871376d8b12583d2
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/src/main/java/jenkins/security/ClassFilterImpl.java
@@ -229,12 +229,12 @@ private boolean isLocationWhitelisted(String _loc) {
LOGGER.log(Level.WARNING, "problem checking " + loc, x);
}
}
if (loc.endsWith("/target/classes/")) {
if (loc.endsWith("/target/classes/") || loc.matches(".+/build/classes/[^/]+/main/")) {
LOGGER.log(Level.FINE, "{0} seems to be current plugin classes, OK", loc);
return true;
}
if (Main.isUnitTest) {
if (loc.endsWith("/target/test-classes/") || loc.endsWith("-tests.jar")) {
if (loc.endsWith("/target/test-classes/") || loc.endsWith("-tests.jar") || loc.matches(".+/build/classes/[^/]+/test/")) {
LOGGER.log(Level.FINE, "{0} seems to be test classes, OK", loc);
return true;
}

0 comments on commit b14ba46

Please sign in to comment.