[java-idp-testbed] branch master updated: IDP-1105 - Upgrade testbed to Jetty 9.3 and bump POM version
Tom Zeller
tzeller at dragonacea.biz
Wed Jan 18 17:50:27 EST 2017
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch master
in repository java-idp-testbed.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-testbed.git;a=commit;h=c72b53253f2830336237eb8dedf93cb82bfb04db
The following commit(s) were added to refs/heads/master by this push:
new c72b532 IDP-1105 - Upgrade testbed to Jetty 9.3 and bump POM version
c72b532 is described below
commit c72b53253f2830336237eb8dedf93cb82bfb04db
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Wed Jan 18 16:49:14 2017 -0600
IDP-1105 - Upgrade testbed to Jetty 9.3 and bump POM version
---
idp-testbed-logback.launch => idp-testbed.launch | 12 +--
pom.xml | 25 ++---
src/main/java/Main.java | 123 +----------------------
3 files changed, 17 insertions(+), 143 deletions(-)
diff --git a/idp-testbed-logback.launch b/idp-testbed.launch
similarity index 56%
rename from idp-testbed-logback.launch
rename to idp-testbed.launch
index 6f3842a..4266005 100644
--- a/idp-testbed-logback.launch
+++ b/idp-testbed.launch
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/java-idp-testbed/src/main/java/Main.java"/>
+<listEntry value="/idp-testbed/src/main/java/Main.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Main"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="java-idp-testbed"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--lib=${workspace_loc:idp-conf/src/test/resources} --lib=${workspace_loc:idp-conf/src/main/resources}"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="idp-testbed"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dlogback.configurationFile=${workspace_loc:idp-conf}/src/main/resources/conf/logback.xml"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djetty.home=/opt/jetty/jetty-9.3 -Didp.home=classpath: -Didp.webflows=classpath*:/flows -Djava.io.tmpdir=tmp"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:idp-jetty-base/src/main/resources/jetty-base}"/>
</launchConfiguration>
diff --git a/pom.xml b/pom.xml
index 045463d..1384a72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,13 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.shibboleth.idp</groupId>
<artifactId>idp-testbed</artifactId>
- <version>0.6.0-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<idp.groupId>net.shibboleth.idp</idp.groupId>
<idp.version>3.4.0-SNAPSHOT</idp.version>
- <idp-jetty-base.version>9.2.0-SNAPSHOT</idp-jetty-base.version>
+ <idp-jetty-base.version>9.3.1-SNAPSHOT</idp-jetty-base.version>
+ <jetty.version>9.3.15.v20161220</jetty.version>
<opensaml.groupId>org.opensaml</opensaml.groupId>
<opensaml.version>3.4.0-SNAPSHOT</opensaml.version>
<spring-extensions.version>5.4.0-SNAPSHOT</spring-extensions.version>
@@ -187,6 +188,11 @@
<artifactId>jetty-jaas</artifactId>
<version>${jetty.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-start</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
<!-- Provided scope -->
<!-- Override Servlet API 3.0.1 with Servlet 3.1.0 for Jetty 9.1+ -->
@@ -234,20 +240,9 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-jsp</artifactId>
+ <artifactId>apache-jsp</artifactId>
<version>${jetty.version}</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.el</artifactId>
- <version>3.0.0</version>
+ <scope>provided</scope>
</dependency>
<dependency>
diff --git a/src/main/java/Main.java b/src/main/java/Main.java
index a4a6674..ea7f89d 100644
--- a/src/main/java/Main.java
+++ b/src/main/java/Main.java
@@ -15,23 +15,6 @@
* limitations under the License.
*/
-import java.net.URL;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.ProtectionDomain;
-import java.util.Properties;
-
-import org.eclipse.jetty.jaas.JAASLoginService;
-import org.eclipse.jetty.security.ConstraintSecurityHandler;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.handler.ContextHandlerCollection;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.util.resource.Resource;
-import org.eclipse.jetty.webapp.WebAppContext;
-import org.eclipse.jetty.xml.XmlConfiguration;
-
/** Start Jetty */
public class Main {
@@ -39,111 +22,7 @@ public class Main {
* @param args
*/
public static void main(String[] args) {
- try {
- // Hack. If protection domain location ends with ".war", then assume we are running from a CLI, otherwise
- // assume we are running from within Eclipse.
- final ProtectionDomain protectionDomain = Main.class.getProtectionDomain();
- final URL location = protectionDomain.getCodeSource().getLocation();
-
- // Set idp.home to "classpath:" so test files in idp-conf/src/test/resources can be found.
- System.setProperty("idp.home", "classpath:");
-
- // Set idp.webflows to "classpath*:/flows" so user flows in multiple locations can be found.
- System.setProperty("idp.webflows", "classpath*:/flows");
-
- // Determine path to jetty-base in the idp-jetty-base project.
- final Path pathToJettyBase =
- Paths.get(Paths.get("").toAbsolutePath().getParent().toAbsolutePath().toString(),
- "java-idp-jetty-base", "src", "main", "resources", "jetty-base");
-
- // Create Jetty configuration from jetty-base/etc/jetty.xml in the idp-distribution module.
- final Path pathToJettyXML = pathToJettyBase.resolve(Paths.get("etc", "jetty.xml"));
- final Resource jettyXML = Resource.newResource(pathToJettyXML.toString());
- final XmlConfiguration configuration = new XmlConfiguration(jettyXML.getInputStream());
-
- // Add properties to the Jetty configuration from jetty-base/start.d/idp.ini in the idp-distribution module.
- final Path pathToIdPIni = pathToJettyBase.resolve(Paths.get("start.d", "idp.ini"));
- final Properties properties = new Properties();
- properties.load(Resource.newResource(pathToIdPIni.toFile().getAbsolutePath()).getInputStream());
- for (String key : properties.stringPropertyNames()) {
- configuration.getProperties().put(key, properties.getProperty(key));
- }
-
- // The keystore paths defined in jetty-base/start.d/idp.ini is relative to jetty.base, which is not correct
- // for the testbed. So replace "../" with path to idp-conf/src/test/resources
- final Path pathToIdPConfTestResources =
- Paths.get(Paths.get("").toAbsolutePath().getParent().toAbsolutePath().toString(),
- "java-identity-provider", "idp-conf", "src", "test", "resources");
- final String idpIniJettyBackchannelKeystorePath = configuration.getProperties().get("jetty.backchannel.keystore.path");
- final String testbedJettyBackchannelKeystorePath =
- idpIniJettyBackchannelKeystorePath
- .replace("../", pathToIdPConfTestResources.toAbsolutePath().toString() + "/");
- configuration.getProperties().put("jetty.backchannel.keystore.path", testbedJettyBackchannelKeystorePath);
- final String idpIniJettyBrowserKeystorePath = configuration.getProperties().get("jetty.browser.keystore.path");
- final String testbedJettyBrowserKeystorePath =
- idpIniJettyBrowserKeystorePath
- .replace("../", pathToIdPConfTestResources.toAbsolutePath().toString() + "/");
- configuration.getProperties().put("jetty.browser.keystore.path", testbedJettyBrowserKeystorePath);
-
- // Configure the Jetty server (with both the XML and properties file configurations).
- final Server server = (Server) configuration.configure();
-
- // The SP and test webapps
- final WebAppContext testbedWebapp = new WebAppContext();
- testbedWebapp.setContextPath("/");
- if (protectionDomain.getCodeSource().getLocation().toString().endsWith(".war")) {
- // Running from command line.
- testbedWebapp.setWar(location.toExternalForm());
- } else {
- // Running from Eclipse.
- testbedWebapp.setWar("src/main/webapp");
- }
-
- // The IdP web app
- // TODO support running from command line
- final Path idpWebappPath =
- Paths.get(Paths.get("").toAbsolutePath().getParent().toAbsolutePath().toString(),
- "java-identity-provider", "idp-war", "src", "main", "webapp");
- final WebAppContext idpWebapp = new WebAppContext();
- idpWebapp.setContextPath("/idp");
- idpWebapp.setWar(idpWebappPath.toString());
-
- final Path override = Paths.get("src", "main", "resources", "conf", "web-override.xml");
- idpWebapp.setOverrideDescriptor(override.toString());
-
- final String idpJaasConfigPath = configuration.getProperties().get("jetty.jaas.path");
- final String testbedJaasConfigPath = pathToIdPConfTestResources.toAbsolutePath().toString()
- + "/" + idpJaasConfigPath;
- System.setProperty("java.security.auth.login.config", testbedJaasConfigPath);
-
- final JAASLoginService jaasLogin = new JAASLoginService();
- jaasLogin.setName("Web Login Service");
- jaasLogin.setLoginModuleName("ShibUserPassAuth");
- final ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler();
- securityHandler.setLoginService(jaasLogin);
- idpWebapp.setSecurityHandler(securityHandler);
-
- final HandlerCollection handlers = new HandlerCollection();
- final ContextHandlerCollection contexts = new ContextHandlerCollection();
- handlers.setHandlers(new Handler[] {contexts, new DefaultHandler()});
-
- contexts.addHandler(testbedWebapp);
- contexts.addHandler(idpWebapp);
-
- // Uncomment to enable TeeFilter.
- // final RequestLogImpl requestLog = new RequestLogImpl();
- // requestLog.setResource("/system/conf/logback-access.xml");
- // final RequestLogHandler requestLogHandler = new RequestLogHandler();
- // requestLogHandler.setRequestLog(requestLog);
- // handlers.addHandler(requestLogHandler);
-
- server.setHandler(handlers);
-
- server.start();
- server.join();
- } catch (final Exception e) {
- e.printStackTrace();
- }
+ org.eclipse.jetty.start.Main.main(args);
}
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list