Skip to content

Commit

Permalink
Merge pull request #294 from oleg-nenashev/plugin-servlet-warning
Browse files Browse the repository at this point in the history
Prevent PluginServletFilter warnings when running JFR as a standalone JAR
  • Loading branch information
oleg-nenashev authored May 10, 2020
2 parents 117a832 + 6515f7b commit e156097
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package io.jenkins.jenkinsfile.runner;

import hudson.ClassicPluginStrategy;
import hudson.util.PluginServletFilter;
import io.jenkins.jenkinsfile.runner.bootstrap.Bootstrap;
import io.jenkins.jenkinsfile.runner.util.HudsonHomeLoader;
import org.eclipse.jetty.security.AbstractLoginService;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.webapp.WebXmlConfiguration;

import javax.servlet.DispatcherType;
import javax.servlet.ServletContext;
import java.util.HashSet;
import java.util.Set;
import java.util.EnumSet;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -54,6 +54,11 @@ protected ServletContext createWebServer() throws Exception {
context.getSecurityHandler().setLoginService(configureUserRealm());
context.setResourceBase(bootstrap.warDir.getPath());

// Jenkins core and some extension points supply extension points which try to access the filter
// In Jenkins core it is define in web.xml
// TODO: Consider reusing Jenkins web.xml instead of manual magic
context.addFilter(PluginServletFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));

server.start();

localPort = -1;
Expand Down

0 comments on commit e156097

Please sign in to comment.