Skip to content

Commit

Permalink
Merge pull request #157 from jglick/jetty
Browse files Browse the repository at this point in the history
Upgrade Jetty
  • Loading branch information
oleg-nenashev authored Nov 6, 2019
2 parents 3b2ce0d + f1a06c9 commit af58dc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.5.v20170502</version>
<version>9.4.22.v20191022</version>
</dependency>
<dependency>
<groupId>net.java.sezpoz</groupId>
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/jenkinsci/maven/plugins/hpi/RunMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
import org.eclipse.jetty.maven.plugin.JettyWebAppContext;
import org.eclipse.jetty.maven.plugin.MavenServerConnector;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.UserStore;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.security.Password;
import org.eclipse.jetty.webapp.WebAppClassLoader;
import org.eclipse.jetty.webapp.WebAppContext;

Expand Down Expand Up @@ -503,9 +505,12 @@ public void configureWebApplication() throws Exception {
}
}
}
// cf. https://wiki.jenkins-ci.org/display/JENKINS/Jetty
HashLoginService hashLoginService = (new HashLoginService("Jenkins Realm"));
hashLoginService.setConfig(System.getProperty("jetty.home", "work") + "/etc/realm.properties");
HashLoginService hashLoginService = (new HashLoginService("default"));
UserStore userStore = new UserStore();
hashLoginService.setUserStore(userStore);
userStore.addUser("alice", new Password("alice"), new String[] {"user", "female"});
userStore.addUser("bob", new Password("bob"), new String[] {"user", "male"});
userStore.addUser("charlie", new Password("charlie"), new String[] {"user", "male"});
getWebAppConfig().getSecurityHandler().setLoginService(hashLoginService);
}

Expand Down

0 comments on commit af58dc0

Please sign in to comment.