- Added multiple alternatives for server modules with different servlet engines.
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index e7b71f8..c69f2ae 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -446,7 +446,7 @@
license text as described above. Its own LICENSE and NOTICE is
copied from the respective files in its `src/main/remote-resources/META-INF`.
<b>There are copies of those in under the java7 platform as well.</b>
- * `edgent-console-server:jar` bundles the console-servlets war and as such
+ * `edgent-console-server-jetty:jar` bundles the console-servlets war and as such
requires the same LICENSE/NOTICE/licenses treatment as the servlets war.
<b>There are copies of its LICENSE/NOTICE in its `src/main/remote-resources/META-INF`.
There are copies of those in under the java7 platform as well.</b>
diff --git a/JAVA_SUPPORT.md b/JAVA_SUPPORT.md
index 38555b3..fb770fb 100644
--- a/JAVA_SUPPORT.md
+++ b/JAVA_SUPPORT.md
@@ -145,7 +145,7 @@
| Jar | Java 8 SE | Java 7 SE | Android | Notes |
|-----------------------------------|-----------|-----------|---------|-------|
-|edgent-console-server-<ver>.jar | yes | yes | no | Uses JMX, Servlet |
+|edgent-console-server-jetty-<ver>.jar | yes | yes | no | Uses JMX, Servlet |
|edgent-console-servlets-<ver>.war | yes | yes | no | Uses JMX, Servlet |
### Android
diff --git a/api/execution/pom.xml b/api/execution/pom.xml
index 0502503..50ff3a3 100644
--- a/api/execution/pom.xml
+++ b/api/execution/pom.xml
@@ -43,7 +43,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
</dependencies>
diff --git a/connectors/csv/pom.xml b/connectors/csv/pom.xml
index 2723b5c..899b5d1 100644
--- a/connectors/csv/pom.xml
+++ b/connectors/csv/pom.xml
@@ -34,7 +34,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
<dependency>
diff --git a/connectors/jdbc/pom.xml b/connectors/jdbc/pom.xml
index 5e7ca2b..b2f1644 100644
--- a/connectors/jdbc/pom.xml
+++ b/connectors/jdbc/pom.xml
@@ -103,7 +103,7 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
- <version>10.13.1.1</version>
+ <version>10.14.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/connectors/kafka/pom.xml b/connectors/kafka/pom.xml
index 51c34a0..8a2aee2 100644
--- a/connectors/kafka/pom.xml
+++ b/connectors/kafka/pom.xml
@@ -100,7 +100,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
- <version>2.10.4</version>
+ <version>2.10.7</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
@@ -122,7 +122,7 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <version>3.4.6</version>
+ <version>3.4.13</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
diff --git a/connectors/websocket-jetty/pom.xml b/connectors/websocket-jetty/pom.xml
index eb3df35..57aa13f 100644
--- a/connectors/websocket-jetty/pom.xml
+++ b/connectors/websocket-jetty/pom.xml
@@ -43,7 +43,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-client-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/connectors/websocket-server/pom.xml b/connectors/websocket-server/pom.xml
index 50f6e73..9cb92b4 100644
--- a/connectors/websocket-server/pom.xml
+++ b/connectors/websocket-server/pom.xml
@@ -43,7 +43,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/console/pom.xml b/console/pom.xml
index 35f7c91..4237258 100644
--- a/console/pom.xml
+++ b/console/pom.xml
@@ -32,7 +32,9 @@
<name>Apache Edgent (Java 8): Console</name>
<modules>
- <module>server</module>
+ <module>server-jetty</module>
+ <module>server-tomcat</module>
+ <module>server-undertow</module>
<module>servlets</module>
</modules>
diff --git a/console/server/pom.xml b/console/server-jetty/pom.xml
similarity index 97%
rename from console/server/pom.xml
rename to console/server-jetty/pom.xml
index 956ff17..4a333ea 100644
--- a/console/server/pom.xml
+++ b/console/server-jetty/pom.xml
@@ -26,9 +26,9 @@
<version>1.3.0-SNAPSHOT</version>
</parent>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
- <name>Apache Edgent (Java 8): Console: Server</name>
+ <name>Apache Edgent (Java 8): Console: Server (Jetty)</name>
<build>
<resources>
diff --git a/console/server/src/main/java/org/apache/edgent/console/server/HttpServer.java b/console/server-jetty/src/main/java/org/apache/edgent/console/server/HttpServer.java
similarity index 100%
rename from console/server/src/main/java/org/apache/edgent/console/server/HttpServer.java
rename to console/server-jetty/src/main/java/org/apache/edgent/console/server/HttpServer.java
diff --git a/console/server/src/main/java/org/apache/edgent/console/server/ServerUtil.java b/console/server-jetty/src/main/java/org/apache/edgent/console/server/ServerUtil.java
similarity index 100%
rename from console/server/src/main/java/org/apache/edgent/console/server/ServerUtil.java
rename to console/server-jetty/src/main/java/org/apache/edgent/console/server/ServerUtil.java
diff --git a/console/server/src/main/remote-resources/META-INF/LICENSE b/console/server-jetty/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
rename from console/server/src/main/remote-resources/META-INF/LICENSE
rename to console/server-jetty/src/main/remote-resources/META-INF/LICENSE
diff --git a/console/server/src/main/remote-resources/META-INF/NOTICE b/console/server-jetty/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
rename from console/server/src/main/remote-resources/META-INF/NOTICE
rename to console/server-jetty/src/main/remote-resources/META-INF/NOTICE
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java b/console/server-jetty/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
similarity index 100%
rename from console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
rename to console/server-jetty/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java b/console/server-jetty/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
similarity index 100%
rename from console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
rename to console/server-jetty/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/ServerUtilTest.java b/console/server-jetty/src/test/java/org/apache/edgent/test/console/server/ServerUtilTest.java
similarity index 100%
rename from console/server/src/test/java/org/apache/edgent/test/console/server/ServerUtilTest.java
rename to console/server-jetty/src/test/java/org/apache/edgent/test/console/server/ServerUtilTest.java
diff --git a/console/server-tomcat/pom.xml b/console/server-tomcat/pom.xml
new file mode 100644
index 0000000..92d6c8a
--- /dev/null
+++ b/console/server-tomcat/pom.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.edgent</groupId>
+ <artifactId>edgent-console</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>edgent-console-server-tomcat</artifactId>
+
+ <name>Apache Edgent (Java 8): Console: Server (Tomcat)</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <targetPath>${project.build.outputDirectory}/</targetPath>
+ </resource>
+ <resource>
+ <!-- bundle the licenses of the artifacts we are bundling -->
+ <directory>${project.basedir}/../../src/main/appended-resources/licenses</directory>
+ <targetPath>${project.build.outputDirectory}/META-INF/licenses</targetPath>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- needed because of HttpServer impl and HttpServerPortTest -->
+ <reuseForks>false</reuseForks>
+ <!-- Make tomcat start within the target directory -->
+ <workingDirectory>${project.build.directory}</workingDirectory>
+ <basedir>${project.build.directory}</basedir>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <version>${tomcat.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.25</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.edgent</groupId>
+ <artifactId>edgent-console-servlets</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <classifier>classes</classifier>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/console/server-tomcat/src/main/java/org/apache/edgent/console/server/HttpServer.java b/console/server-tomcat/src/main/java/org/apache/edgent/console/server/HttpServer.java
new file mode 100644
index 0000000..212cc69
--- /dev/null
+++ b/console/server-tomcat/src/main/java/org/apache/edgent/console/server/HttpServer.java
@@ -0,0 +1,169 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package org.apache.edgent.console.server;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.edgent.console.servlets.ConsoleJobServlet;
+import org.apache.edgent.console.servlets.ConsoleMetricsServlet;
+import org.apache.edgent.console.servlets.ConsoleServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * The "Edgent Console".
+ * <p>
+ * The Console's HTTP server starts with a random available port unless
+ * a port is specified via the {@code edgent.console.port} system property.
+ */
+public class HttpServer {
+
+ private static final Logger logger = LoggerFactory.getLogger(HttpServer.class);
+
+ /**
+ * The only constructor. A private no-argument constructor. Called only once from the static HttpServerHolder class.
+ */
+ private HttpServer() {
+ }
+
+ /**
+ * The static class that creates the singleton HttpServer object.
+ */
+ private static class HttpServerHolder {
+ // use port 0 if system prop not set, so we know the server will always start
+ private static final Tomcat TOMCATSERVER;
+ static {
+ TOMCATSERVER = new Tomcat();
+ TOMCATSERVER.setPort(Integer.getInteger("edgent.console.port", 0));
+ // Trigger the creation of the default connector
+ TOMCATSERVER.getConnector();
+ }
+
+ private static Context CONSOLE_CONTEXT;
+ private static final HttpServer INSTANCE = new HttpServer();
+ private static boolean INITIALIZED = false;
+ }
+
+ /**
+ * Gets the tomcat server associated with this class
+ * @return the org.apache.catalina.startup.Tomcat
+ */
+ private static Tomcat getTomcatServer() {
+ return HttpServerHolder.TOMCATSERVER;
+ }
+
+ /**
+ * Initialization of the context path for the web application "/console" occurs in this method
+ * and the handler for the web application is set. This only occurs once.
+ * @return HttpServer: the singleton instance of this class
+ */
+ public static HttpServer getInstance() {
+ if (!HttpServerHolder.INITIALIZED) {
+ logger.info("initializing");
+
+ Tomcat tomcat = HttpServerHolder.TOMCATSERVER;
+
+ // Initialize the console context
+ Context context = tomcat.addContext("/console", new File(".").getAbsolutePath());
+ HttpServerHolder.CONSOLE_CONTEXT = context;
+
+ // Initialize the console servlet.
+ Class consoleServletClass = ConsoleServlet.class;
+ String consoleServletName = consoleServletClass.getSimpleName();
+ Tomcat.addServlet(context, consoleServletName, consoleServletClass.getName());
+ context.addServletMappingDecoded("/console/*", consoleServletName);
+
+ // Initialize the jobs servlet.
+ Class jobsServletClass = ConsoleJobServlet.class;
+ String jobsServletName = jobsServletClass.getSimpleName();
+ Tomcat.addServlet(context, jobsServletName, jobsServletClass.getName());
+ context.addServletMappingDecoded("/console/jobs/*", jobsServletName);
+
+ // Initialize the metrics servlet.
+ Class metricsServletClass = ConsoleMetricsServlet.class;
+ String metricsServletName = metricsServletClass.getSimpleName();
+ Tomcat.addServlet(context, metricsServletName, metricsServletClass.getName());
+ context.addServletMappingDecoded("/console/metrics/*", metricsServletName);
+
+ HttpServerHolder.INITIALIZED = true;
+ }
+ return HttpServerHolder.INSTANCE;
+ }
+
+ /**
+ *
+ * @return a String containing the context path to the console web application
+ */
+ public String getConsoleContextPath() {
+ return HttpServerHolder.CONSOLE_CONTEXT.getPath();
+ }
+
+ /**
+ * Starts the tomcat web server
+ * @throws Exception on failure
+ */
+ public void startServer() throws Exception {
+ getTomcatServer().start();
+ }
+
+ /**
+ * Stops the tomcat web server
+ * @throws Exception on failure
+ */
+ @SuppressWarnings("unused")
+ private static void stopServer() throws Exception {
+ getTomcatServer().stop();
+ }
+
+ /**
+ * Checks to see if the tomcat web server is started
+ * @return a boolean: true if the server is started, false if not
+ */
+ public boolean isServerStarted() {
+ return getTomcatServer().getConnector().getState().isAvailable();
+ }
+
+ /**
+ * Checks to see if the server is in a "stopping" or "stopped" state
+ * @return a boolean: true if the server is stopping or stopped, false otherwise
+ */
+ public boolean isServerStopped() {
+ return !getTomcatServer().getConnector().getState().isAvailable();
+ }
+
+ /**
+ * Returns the port number the console is running on. Each time the console is started a different port number may be returned.
+ * @return an int: the port number the jetty server is listening on
+ */
+ public int getConsolePortNumber() {
+ return getTomcatServer().getConnector().getLocalPort();
+ }
+
+ /**
+ * Returns the url for the web application at the "console" context path. Localhost is always assumed
+ * @return the url for the web application at the "console" context path.
+ */
+ public String getConsoleUrl() {
+ return "http://localhost" + ":" + getConsolePortNumber() + getConsoleContextPath();
+ }
+
+}
diff --git a/console/server/src/main/remote-resources/META-INF/LICENSE b/console/server-tomcat/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
copy from console/server/src/main/remote-resources/META-INF/LICENSE
copy to console/server-tomcat/src/main/remote-resources/META-INF/LICENSE
diff --git a/console/server/src/main/remote-resources/META-INF/NOTICE b/console/server-tomcat/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
copy from console/server/src/main/remote-resources/META-INF/NOTICE
copy to console/server-tomcat/src/main/remote-resources/META-INF/NOTICE
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java b/console/server-tomcat/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
similarity index 100%
copy from console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
copy to console/server-tomcat/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java b/console/server-tomcat/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
similarity index 100%
copy from console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
copy to console/server-tomcat/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
diff --git a/console/server-undertow/pom.xml b/console/server-undertow/pom.xml
new file mode 100644
index 0000000..e921136
--- /dev/null
+++ b/console/server-undertow/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.edgent</groupId>
+ <artifactId>edgent-console</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>edgent-console-server-undertow</artifactId>
+
+ <name>Apache Edgent (Java 8): Console: Server (Undertow)</name>
+
+ <properties>
+ <undertow.version>2.0.11.Final</undertow.version>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <targetPath>${project.build.outputDirectory}/</targetPath>
+ </resource>
+ <resource>
+ <!-- bundle the licenses of the artifacts we are bundling -->
+ <directory>${project.basedir}/../../src/main/appended-resources/licenses</directory>
+ <targetPath>${project.build.outputDirectory}/META-INF/licenses</targetPath>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- needed because of HttpServer impl and HttpServerPortTest -->
+ <reuseForks>false</reuseForks>
+ <!-- Make tomcat start within the target directory -->
+ <workingDirectory>${project.build.directory}</workingDirectory>
+ <basedir>${project.build.directory}</basedir>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-servlet</artifactId>
+ <version>${undertow.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.25</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.edgent</groupId>
+ <artifactId>edgent-console-servlets</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <classifier>classes</classifier>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/console/server-undertow/src/main/java/org/apache/edgent/console/server/HttpServer.java b/console/server-undertow/src/main/java/org/apache/edgent/console/server/HttpServer.java
new file mode 100644
index 0000000..801f15b
--- /dev/null
+++ b/console/server-undertow/src/main/java/org/apache/edgent/console/server/HttpServer.java
@@ -0,0 +1,189 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package org.apache.edgent.console.server;
+
+import io.undertow.Handlers;
+import io.undertow.Undertow;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.handlers.PathHandler;
+import io.undertow.servlet.Servlets;
+import io.undertow.servlet.api.DeploymentInfo;
+import io.undertow.servlet.api.DeploymentManager;
+import org.apache.edgent.console.servlets.ConsoleJobServlet;
+import org.apache.edgent.console.servlets.ConsoleMetricsServlet;
+import org.apache.edgent.console.servlets.ConsoleServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.InetSocketAddress;
+import java.util.List;
+
+/**
+ * The "Edgent Console".
+ * <p>
+ * The Console's HTTP server starts with a random available port unless
+ * a port is specified via the {@code edgent.console.port} system property.
+ */
+public class HttpServer {
+
+ private static final Logger logger = LoggerFactory.getLogger(HttpServer.class);
+
+ /**
+ * The only constructor. A private no-argument constructor. Called only once from the static HttpServerHolder class.
+ */
+ private HttpServer() {
+ }
+
+ /**
+ * The static class that creates the singleton HttpServer object.
+ */
+ private static class HttpServerHolder {
+ private static String context = "/console";
+ private static int port = Integer.getInteger("edgent.console.port", 0);
+ // use port 0 if system prop not set, so we know the server will always start
+ private static Undertow SERVER;
+
+ private static final HttpServer INSTANCE = new HttpServer();
+ private static boolean INITIALIZED = false;
+ }
+
+ /**
+ * Gets the undertow server associated with this class
+ * @return the io.undertow.Undertow
+ */
+ private static Undertow getUndertowServer() {
+ return HttpServerHolder.SERVER;
+ }
+
+ /**
+ * Initialization of the context path for the web application "/console" occurs in this method
+ * and the handler for the web application is set. This only occurs once.
+ * @return HttpServer: the singleton instance of this class
+ */
+ public static HttpServer getInstance() throws Exception {
+ if (!HttpServerHolder.INITIALIZED) {
+ logger.info("initializing");
+
+ DeploymentInfo servletBuilder = Servlets.deployment()
+ .setClassLoader(HttpServer.class.getClassLoader())
+ .setContextPath("/console")
+ .setDeploymentName("console.war")
+ .addServlets(
+ Servlets.servlet(ConsoleServlet.class.getSimpleName(), ConsoleServlet.class)
+ .addMapping("/console/*"),
+ Servlets.servlet(ConsoleJobServlet.class.getSimpleName(), ConsoleJobServlet.class)
+ .addMapping("/console/jobs/*"),
+ Servlets.servlet(ConsoleMetricsServlet.class.getSimpleName(), ConsoleMetricsServlet.class)
+ .addMapping("/console/metrics/*")
+ );
+
+ DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder);
+ manager.deploy();
+
+ HttpHandler servletHandler = manager.start();
+ PathHandler path = Handlers.path(Handlers.redirect(HttpServerHolder.context))
+ .addPrefixPath(HttpServerHolder.context, servletHandler);
+
+ HttpServerHolder.SERVER = Undertow.builder()
+ .addHttpListener(HttpServerHolder.port, "localhost")
+ .setHandler(path)
+ .build();
+
+ HttpServerHolder.INITIALIZED = true;
+ }
+ return HttpServerHolder.INSTANCE;
+ }
+
+ /**
+ *
+ * @return a String containing the context path to the console web application
+ */
+ public String getConsoleContextPath() {
+ return HttpServerHolder.context;
+ }
+
+ /**
+ * Starts the tomcat web server
+ */
+ public void startServer() {
+ if(!isServerStarted()) {
+ getUndertowServer().start();
+ }
+ }
+
+ /**
+ * Stops the tomcat web server
+ * @throws Exception on failure
+ */
+ @SuppressWarnings("unused")
+ private static void stopServer() {
+ getUndertowServer().stop();
+ }
+
+ /**
+ * Checks to see if the tomcat web server is started
+ * @return a boolean: true if the server is started, false if not
+ */
+ public boolean isServerStarted() {
+ try {
+ HttpServerHolder.SERVER.getListenerInfo();
+ return true;
+ } catch(IllegalStateException e) {
+ if ("UT000138: Server not started".equals(e.getMessage())) {
+ return false;
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ /**
+ * Checks to see if the server is in a "stopping" or "stopped" state
+ * @return a boolean: true if the server is stopping or stopped, false otherwise
+ */
+ public boolean isServerStopped() {
+ return !isServerStarted();
+ }
+
+ /**
+ * Returns the port number the console is running on. Each time the console is started a different port number may be returned.
+ * @return an int: the port number the jetty server is listening on
+ */
+ public int getConsolePortNumber() {
+ List<Undertow.ListenerInfo> listenerInfos = HttpServerHolder.SERVER.getListenerInfo();
+ if(!listenerInfos.isEmpty()) {
+ Undertow.ListenerInfo listenerInfo = listenerInfos.iterator().next();
+ if(listenerInfo.getAddress() instanceof InetSocketAddress) {
+ InetSocketAddress address = (InetSocketAddress) listenerInfo.getAddress();
+ return address.getPort();
+ }
+ }
+ return HttpServerHolder.port;
+ }
+
+ /**
+ * Returns the url for the web application at the "console" context path. Localhost is always assumed
+ * @return the url for the web application at the "console" context path.
+ */
+ public String getConsoleUrl() {
+ return "http://localhost" + ":" + getConsolePortNumber() + getConsoleContextPath();
+ }
+
+}
diff --git a/console/server/src/main/remote-resources/META-INF/LICENSE b/console/server-undertow/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
copy from console/server/src/main/remote-resources/META-INF/LICENSE
copy to console/server-undertow/src/main/remote-resources/META-INF/LICENSE
diff --git a/console/server/src/main/remote-resources/META-INF/NOTICE b/console/server-undertow/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
copy from console/server/src/main/remote-resources/META-INF/NOTICE
copy to console/server-undertow/src/main/remote-resources/META-INF/NOTICE
diff --git a/console/server-undertow/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java b/console/server-undertow/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
new file mode 100644
index 0000000..82fc79a
--- /dev/null
+++ b/console/server-undertow/src/test/java/org/apache/edgent/test/console/server/HttpServerPortTest.java
@@ -0,0 +1,58 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+package org.apache.edgent.test.console.server;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.edgent.console.server.HttpServer;
+import org.junit.Test;
+
+/**
+ * This is a separate test because the HttpServer implementation
+ * precludes changing the console port within a jvm instance.
+ */
+public class HttpServerPortTest {
+
+ int getAvailablePort() throws IOException {
+ try (Socket s = new Socket()) {
+ s.bind(null);
+ return s.getLocalPort();
+ }
+ }
+
+ @Test
+ public void testOverridePortNumber() throws Exception {
+ // count on the OS not immediately reusing an available local port.
+ int port = getAvailablePort();
+ int port2 = getAvailablePort();
+ assumeTrue(port != port2);
+
+ System.setProperty("edgent.console.port", String.valueOf(port));
+ HttpServer myHttpServer = HttpServer.getInstance();
+ myHttpServer.startServer();
+
+ int portNum = myHttpServer.getConsolePortNumber();
+ assertEquals(port, portNum);
+ }
+
+}
diff --git a/console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java b/console/server-undertow/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
similarity index 100%
copy from console/server/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
copy to console/server-undertow/src/test/java/org/apache/edgent/test/console/server/HttpServerTest.java
diff --git a/console/servlets/pom.xml b/console/servlets/pom.xml
index afd4376..13b62ff 100644
--- a/console/servlets/pom.xml
+++ b/console/servlets/pom.xml
@@ -129,6 +129,14 @@
</execution>
</executions>
</plugin>
+ <!-- Additionally create a jar version containing only the classes -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <attachClasses>true</attachClasses>
+ </configuration>
+ </plugin>
<!-- Download JavaScript form GitHub -->
<!--plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 43bc4dc..0fadefc 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -205,8 +205,8 @@
<!-- Include console-servlets.war to enable a user to run
it in their own Servlets engine.
- It's bundled in the edgent-console-server.jar.
- Note, edgent-console-server is pulled in as a dependency
+ It's bundled in the edgent-console-server-jetty.jar.
+ Note, edgent-console-server-jetty is pulled in as a dependency
of the development provider.
-->
<dependency>
diff --git a/platforms/android/android/hardware/pom.xml b/platforms/android/android/hardware/pom.xml
index afcd62d..c832ccb 100644
--- a/platforms/android/android/hardware/pom.xml
+++ b/platforms/android/android/hardware/pom.xml
@@ -48,4 +48,15 @@
</dependency>
</dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <!-- The default version pulled in by the android dependency has vulnerabilities -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.5</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
</project>
diff --git a/platforms/android/android/topology/pom.xml b/platforms/android/android/topology/pom.xml
index 2739efe..0a54f06 100644
--- a/platforms/android/android/topology/pom.xml
+++ b/platforms/android/android/topology/pom.xml
@@ -53,4 +53,15 @@
</dependency>
</dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <!-- The default version pulled in by the android dependency has vulnerabilities -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.5</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
</project>
diff --git a/platforms/android/api/execution/pom.xml b/platforms/android/api/execution/pom.xml
index 113dadd..578b824 100644
--- a/platforms/android/api/execution/pom.xml
+++ b/platforms/android/api/execution/pom.xml
@@ -72,7 +72,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
</dependencies>
diff --git a/platforms/android/connectors/csv/pom.xml b/platforms/android/connectors/csv/pom.xml
index 1b2cb14..79aceac 100644
--- a/platforms/android/connectors/csv/pom.xml
+++ b/platforms/android/connectors/csv/pom.xml
@@ -63,7 +63,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
</dependencies>
diff --git a/platforms/android/connectors/kafka/pom.xml b/platforms/android/connectors/kafka/pom.xml
index 8473f4a..2aa3e6c 100644
--- a/platforms/android/connectors/kafka/pom.xml
+++ b/platforms/android/connectors/kafka/pom.xml
@@ -130,7 +130,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
- <version>2.10.4</version>
+ <version>2.10.7</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
@@ -152,7 +152,7 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <version>3.4.6</version>
+ <version>3.4.13</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
diff --git a/platforms/android/connectors/websocket-jetty/pom.xml b/platforms/android/connectors/websocket-jetty/pom.xml
index 8ef8776..f1c2c34 100644
--- a/platforms/android/connectors/websocket-jetty/pom.xml
+++ b/platforms/android/connectors/websocket-jetty/pom.xml
@@ -72,7 +72,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-client-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/platforms/android/connectors/websocket-server/pom.xml b/platforms/android/connectors/websocket-server/pom.xml
index 3b4cb63..8551195 100644
--- a/platforms/android/connectors/websocket-server/pom.xml
+++ b/platforms/android/connectors/websocket-server/pom.xml
@@ -72,7 +72,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/platforms/android/distribution/pom.xml b/platforms/android/distribution/pom.xml
index cacd83b..158ed85 100644
--- a/platforms/android/distribution/pom.xml
+++ b/platforms/android/distribution/pom.xml
@@ -219,8 +219,8 @@
<!-- Include console-servlets.war to enable a user to run
it in their own Servlets engine.
- It's bundled in the edgent-console-server.jar.
- Note, edgent-console-server is pulled in as a dependency
+ It's bundled in the edgent-console-server-jetty.jar.
+ Note, edgent-console-server-jetty is pulled in as a dependency
of the development provider.
-->
<!-- Not on android <dependency>
diff --git a/platforms/android/pom.xml b/platforms/android/pom.xml
index 57171dd..f52d006 100644
--- a/platforms/android/pom.xml
+++ b/platforms/android/pom.xml
@@ -57,7 +57,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
+ <version>1.16</version>
<executions>
<execution>
<id>check-jdk-signatures</id>
diff --git a/platforms/java7/api/execution/pom.xml b/platforms/java7/api/execution/pom.xml
index 880d89f..5d98c60 100644
--- a/platforms/java7/api/execution/pom.xml
+++ b/platforms/java7/api/execution/pom.xml
@@ -91,7 +91,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
</dependencies>
diff --git a/platforms/java7/connectors/csv/pom.xml b/platforms/java7/connectors/csv/pom.xml
index c45d83b..d86314f 100644
--- a/platforms/java7/connectors/csv/pom.xml
+++ b/platforms/java7/connectors/csv/pom.xml
@@ -82,7 +82,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.8.0</version>
</dependency>
<dependency>
diff --git a/platforms/java7/connectors/jdbc/pom.xml b/platforms/java7/connectors/jdbc/pom.xml
index a9cf716..8cd199b 100644
--- a/platforms/java7/connectors/jdbc/pom.xml
+++ b/platforms/java7/connectors/jdbc/pom.xml
@@ -100,6 +100,27 @@
</execution>
</executions>
</plugin>
+ <!--
+ We are using derby for some tests. Unfortunately the latest version
+ runnable with Java 7 contains a vulnerability, making it problematic
+ to use in an application.
+
+ As we are simply using derby inside a test and not using it in production
+ code, we have to tell the audit tool not to complain about this.
+ -->
+ <plugin>
+ <groupId>org.sonatype.ossindex.maven</groupId>
+ <artifactId>ossindex-maven-plugin</artifactId>
+ <configuration>
+ <excludeCoordinates>
+ <exclude>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.12.1.1</version>
+ </exclude>
+ </excludeCoordinates>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -146,7 +167,7 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
- <!-- requires java8: <version>10.13.1.1</version-->
+ <!-- requires java8: <version>10.14.2.0</version-->
<version>10.12.1.1</version> <!-- latest Java 6 and Higher -->
<scope>test</scope>
</dependency>
diff --git a/platforms/java7/connectors/kafka/pom.xml b/platforms/java7/connectors/kafka/pom.xml
index 94823ef..36d841f 100644
--- a/platforms/java7/connectors/kafka/pom.xml
+++ b/platforms/java7/connectors/kafka/pom.xml
@@ -149,7 +149,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
- <version>2.10.4</version>
+ <version>2.10.7</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
@@ -171,7 +171,7 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <version>3.4.6</version>
+ <version>3.4.13</version>
<exclusions>
<exclusion> <!-- not transitive -->
<groupId>*</groupId>
diff --git a/platforms/java7/connectors/websocket-jetty/pom.xml b/platforms/java7/connectors/websocket-jetty/pom.xml
index 70ba1d5..aaabe0a 100644
--- a/platforms/java7/connectors/websocket-jetty/pom.xml
+++ b/platforms/java7/connectors/websocket-jetty/pom.xml
@@ -98,7 +98,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-client-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/platforms/java7/connectors/websocket-server/pom.xml b/platforms/java7/connectors/websocket-server/pom.xml
index abac9bf..eb77649 100644
--- a/platforms/java7/connectors/websocket-server/pom.xml
+++ b/platforms/java7/connectors/websocket-server/pom.xml
@@ -91,7 +91,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
- <version>9.3.6.v20151106</version>
+ <version>9.4.8.v20180619</version>
</dependency>
</dependencies>
diff --git a/platforms/java7/console/pom.xml b/platforms/java7/console/pom.xml
index 26eca84..34ab87e 100644
--- a/platforms/java7/console/pom.xml
+++ b/platforms/java7/console/pom.xml
@@ -32,7 +32,9 @@
<name>Apache Edgent (Java 7): Console</name>
<modules>
- <module>server</module>
+ <!--module>server-jetty</module>
+ <module>server-tomcat</module-->
+ <module>server-undertow</module>
<module>servlets</module>
</modules>
diff --git a/platforms/java7/console/server/pom.xml b/platforms/java7/console/server-jetty/pom.xml
similarity index 97%
rename from platforms/java7/console/server/pom.xml
rename to platforms/java7/console/server-jetty/pom.xml
index 1f1cbd4..c386f4d 100644
--- a/platforms/java7/console/server/pom.xml
+++ b/platforms/java7/console/server-jetty/pom.xml
@@ -26,9 +26,9 @@
<version>1.3.0-SNAPSHOT</version>
</parent>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
- <name>Apache Edgent (Java 7): Console: Server</name>
+ <name>Apache Edgent (Java 7): Console: Server (Jetty)</name>
<build>
<resources>
@@ -177,7 +177,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.12</version>
+ <version>1.7.25</version>
</dependency>
<!--
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE b/platforms/java7/console/server-jetty/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
rename from platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE
rename to platforms/java7/console/server-jetty/src/main/remote-resources/META-INF/LICENSE
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE b/platforms/java7/console/server-jetty/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
rename from platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE
rename to platforms/java7/console/server-jetty/src/main/remote-resources/META-INF/NOTICE
diff --git a/platforms/java7/console/server/pom.xml b/platforms/java7/console/server-tomcat/pom.xml
similarity index 61%
copy from platforms/java7/console/server/pom.xml
copy to platforms/java7/console/server-tomcat/pom.xml
index 1f1cbd4..36e9117 100644
--- a/platforms/java7/console/server/pom.xml
+++ b/platforms/java7/console/server-tomcat/pom.xml
@@ -26,9 +26,13 @@
<version>1.3.0-SNAPSHOT</version>
</parent>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-tomcat</artifactId>
- <name>Apache Edgent (Java 7): Console: Server</name>
+ <name>Apache Edgent (Java 7): Console: Server (Tomcat)</name>
+
+ <properties>
+ <tomcat.version>7.0.90</tomcat.version>
+ </properties>
<build>
<resources>
@@ -46,29 +50,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
- <!--
- Copy the servlets.war into the build output so it is embedded as
- resource into the jar.
- -->
- <execution>
- <id>copy-war</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.edgent.java7</groupId>
- <artifactId>edgent-console-servlets</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
- <destFileName>servlets.war</destFileName>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
<execution>
<id>copy</id>
<phase>compile</phase>
@@ -112,8 +93,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <!-- needed because of HttpServer impl and HttpServerPortTest -->
- <reuseForks>false</reuseForks>
+ <!-- needed because of HttpServer impl and HttpServerPortTest -->
+ <reuseForks>false</reuseForks>
+ <!-- Make tomcat start within the target directory -->
+ <workingDirectory>${project.build.directory}</workingDirectory>
+ <basedir>${project.build.directory}</basedir>
</configuration>
</plugin>
</plugins>
@@ -135,63 +119,26 @@
<dependencies>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-http</artifactId>
- <version>${jetty.version}</version>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-io</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-security</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-xml</artifactId>
- <version>${jetty.version}</version>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.12</version>
+ <version>1.7.25</version>
</dependency>
- <!--
- This artifact is needed by the maven-dependency-plugin
- by marking this dependency optional, it is not included
- in the resulting artifact, but Maven ensures it is built
- prior to this module.
- -->
<dependency>
<groupId>org.apache.edgent.java7</groupId>
<artifactId>edgent-console-servlets</artifactId>
<version>1.3.0-SNAPSHOT</version>
- <type>war</type>
- <optional>true</optional>
+ <classifier>classes</classifier>
</dependency>
</dependencies>
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE b/platforms/java7/console/server-tomcat/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
copy from platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE
copy to platforms/java7/console/server-tomcat/src/main/remote-resources/META-INF/LICENSE
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE b/platforms/java7/console/server-tomcat/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
copy from platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE
copy to platforms/java7/console/server-tomcat/src/main/remote-resources/META-INF/NOTICE
diff --git a/platforms/java7/console/server/pom.xml b/platforms/java7/console/server-undertow/pom.xml
similarity index 61%
copy from platforms/java7/console/server/pom.xml
copy to platforms/java7/console/server-undertow/pom.xml
index 1f1cbd4..a8a75a1 100644
--- a/platforms/java7/console/server/pom.xml
+++ b/platforms/java7/console/server-undertow/pom.xml
@@ -26,9 +26,13 @@
<version>1.3.0-SNAPSHOT</version>
</parent>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-undertow</artifactId>
- <name>Apache Edgent (Java 7): Console: Server</name>
+ <name>Apache Edgent (Java 7): Console: Server (Undertow)</name>
+
+ <properties>
+ <undertow.version>1.4.25.Final</undertow.version>
+ </properties>
<build>
<resources>
@@ -46,29 +50,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
- <!--
- Copy the servlets.war into the build output so it is embedded as
- resource into the jar.
- -->
- <execution>
- <id>copy-war</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.edgent.java7</groupId>
- <artifactId>edgent-console-servlets</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
- <destFileName>servlets.war</destFileName>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
<execution>
<id>copy</id>
<phase>compile</phase>
@@ -112,8 +93,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <!-- needed because of HttpServer impl and HttpServerPortTest -->
- <reuseForks>false</reuseForks>
+ <!-- needed because of HttpServer impl and HttpServerPortTest -->
+ <reuseForks>false</reuseForks>
+ <!-- Make tomcat start within the target directory -->
+ <workingDirectory>${project.build.directory}</workingDirectory>
+ <basedir>${project.build.directory}</basedir>
</configuration>
</plugin>
</plugins>
@@ -135,63 +119,21 @@
<dependencies>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-http</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-io</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-security</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-xml</artifactId>
- <version>${jetty.version}</version>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-servlet</artifactId>
+ <version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.12</version>
+ <version>1.7.25</version>
</dependency>
- <!--
- This artifact is needed by the maven-dependency-plugin
- by marking this dependency optional, it is not included
- in the resulting artifact, but Maven ensures it is built
- prior to this module.
- -->
<dependency>
<groupId>org.apache.edgent.java7</groupId>
<artifactId>edgent-console-servlets</artifactId>
<version>1.3.0-SNAPSHOT</version>
- <type>war</type>
- <optional>true</optional>
+ <classifier>classes</classifier>
</dependency>
</dependencies>
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE b/platforms/java7/console/server-undertow/src/main/remote-resources/META-INF/LICENSE
similarity index 100%
copy from platforms/java7/console/server/src/main/remote-resources/META-INF/LICENSE
copy to platforms/java7/console/server-undertow/src/main/remote-resources/META-INF/LICENSE
diff --git a/platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE b/platforms/java7/console/server-undertow/src/main/remote-resources/META-INF/NOTICE
similarity index 100%
copy from platforms/java7/console/server/src/main/remote-resources/META-INF/NOTICE
copy to platforms/java7/console/server-undertow/src/main/remote-resources/META-INF/NOTICE
diff --git a/platforms/java7/console/servlets/pom.xml b/platforms/java7/console/servlets/pom.xml
index 5a53177..13ab196 100644
--- a/platforms/java7/console/servlets/pom.xml
+++ b/platforms/java7/console/servlets/pom.xml
@@ -115,6 +115,8 @@
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
+ <!-- Additionally create a jar version containing only the classes -->
+ <attachClasses>true</attachClasses>
</configuration>
</plugin>
</plugins>
diff --git a/platforms/java7/distribution/pom.xml b/platforms/java7/distribution/pom.xml
index 1a6376b..6885a9a 100644
--- a/platforms/java7/distribution/pom.xml
+++ b/platforms/java7/distribution/pom.xml
@@ -205,8 +205,8 @@
<!-- Include console-servlets.war to enable a user to run
it in their own Servlets engine.
- It's bundled in the edgent-console-server.jar.
- Note, edgent-console-server is pulled in as a dependency
+ It's bundled in the edgent-console-server-jetty.jar.
+ Note, edgent-console-server-jetty is pulled in as a dependency
of the development provider.
-->
<dependency>
diff --git a/platforms/java7/pom.xml b/platforms/java7/pom.xml
index bcd7b7c..c73e170 100644
--- a/platforms/java7/pom.xml
+++ b/platforms/java7/pom.xml
@@ -91,7 +91,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
+ <version>1.16</version>
<executions>
<execution>
<id>check-jdk-signatures</id>
diff --git a/platforms/java7/providers/development/pom.xml b/platforms/java7/providers/development/pom.xml
index 7a541af..9db0614 100644
--- a/platforms/java7/providers/development/pom.xml
+++ b/platforms/java7/providers/development/pom.xml
@@ -90,7 +90,7 @@
</dependency>
<dependency>
<groupId>org.apache.edgent.java7</groupId>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<dependency>
diff --git a/platforms/java7/test/svt/pom.xml b/platforms/java7/test/svt/pom.xml
index f812c55..9806a57 100644
--- a/platforms/java7/test/svt/pom.xml
+++ b/platforms/java7/test/svt/pom.xml
@@ -98,7 +98,7 @@
</dependency>
<dependency>
<groupId>org.apache.edgent.java7</groupId>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<dependency>
diff --git a/pom.xml b/pom.xml
index 6450e14..99c8ef7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,9 +51,10 @@
<project.reporting.outputencoding>UTF-8</project.reporting.outputencoding>
<maven.version>3.3.1</maven.version>
- <jetty.version>9.3.6.v20151106</jetty.version>
+ <jetty.version>9.4.8.v20180619</jetty.version>
+ <tomcat.version>9.0.10</tomcat.version>
<gson.version>2.2.4</gson.version>
- <slf4j.version>1.7.12</slf4j.version>
+ <slf4j.version>1.7.25</slf4j.version>
<!-- URL of the ASF SonarQube server -->
<sonar.host.url>https://builds.apache.org/analysis</sonar.host.url>
@@ -202,6 +203,12 @@
<version>3.3.0.603</version>
</plugin>
+ <plugin>
+ <groupId>org.sonatype.ossindex.maven</groupId>
+ <artifactId>ossindex-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ </plugin>
+
<!--
This is a fake plugin which is used to tell m2e (Eclipse) how
to process this maven project.
@@ -300,6 +307,22 @@
</pluginManagement>
<plugins>
+
+ <!-- Audit all dependencies for known vulnerabilities -->
+ <plugin>
+ <groupId>org.sonatype.ossindex.maven</groupId>
+ <artifactId>ossindex-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>audit-dependencies</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>audit</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
<!-- Check if all source files have the required apache license headers -->
<plugin>
<groupId>org.apache.rat</groupId>
@@ -637,7 +660,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
+ <version>1.16</version>
<executions>
<execution>
<id>check-jdk-signatures</id>
@@ -870,7 +893,7 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
- <version>3.1.2</version>
+ <version>3.2.6</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
@@ -893,6 +916,21 @@
</dependency>
</dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<repositories>
<repository>
<id>apache-release</id>
diff --git a/providers/development/pom.xml b/providers/development/pom.xml
index 692cf9e..cfc8e69 100644
--- a/providers/development/pom.xml
+++ b/providers/development/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.apache.edgent</groupId>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<dependency>
diff --git a/test/svt/pom.xml b/test/svt/pom.xml
index 06dd1a3..c0c99d6 100644
--- a/test/svt/pom.xml
+++ b/test/svt/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.apache.edgent</groupId>
- <artifactId>edgent-console-server</artifactId>
+ <artifactId>edgent-console-server-jetty</artifactId>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<dependency>