Adding ability to start spdy server/client using maven.

This commit is contained in:
Daniel Bevenius 2014-02-07 10:49:22 +01:00 committed by Norman Maurer
parent e7b800eb82
commit 891df2116c
5 changed files with 246 additions and 0 deletions

View File

@ -89,5 +89,230 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty.npn</groupId>
<artifactId>npn-boot</artifactId>
<version>${npn.version}</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/npn</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>spdy-server</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>${java.home}/bin/java</executable>
<arguments>
<argument>-Xbootclasspath/p:${project.build.directory}/npn/npn-boot-${npn.version}.jar</argument>
<argument>-classpath</argument>
<classpath/>
<argument>io.netty.example.spdy.server.SpdyServer</argument>
</arguments>
<classpathScope>compile</classpathScope>
<systemProperties>
<property>
<key>io.netty.leakDetectionLevel</key>
<value>disabled</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>spdy-client</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>${java.home}/bin/java</executable>
<arguments>
<argument>-Xbootclasspath/p:${project.build.directory}/npn/npn-boot-${npn.version}.jar</argument>
<argument>-classpath</argument>
<classpath/>
<argument>io.netty.example.spdy.client.SpdyClient</argument>
</arguments>
<classpathScope>compile</classpathScope>
<systemProperties>
<property>
<key>io.netty.leakDetectionLevel</key>
<value>disabled</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!--
profiles for the various npn vs OpenJDK version as found on:
http://www.eclipse.org/jetty/documentation/current/npn-chapter.html#npn-versions
-->
<profile>
<id>7u9</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_9</value>
</property>
</activation>
<properties>
<npn.version>1.1.3.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u10</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_10</value>
</property>
</activation>
<properties>
<npn.version>1.1.3.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u11</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_11</value>
</property>
</activation>
<properties>
<npn.version>1.1.3.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u13</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_13</value>
</property>
</activation>
<properties>
<npn.version>1.1.4.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u15</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_15</value>
</property>
</activation>
<properties>
<npn.version>1.1.5.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u17</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_17</value>
</property>
</activation>
<properties>
<npn.version>1.1.5.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u21</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_21</value>
</property>
</activation>
<properties>
<npn.version>1.1.5.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u25</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_25</value>
</property>
</activation>
<properties>
<npn.version>1.1.5.v20130313</npn.version>
</properties>
</profile>
<profile>
<id>7u40</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_40</value>
</property>
</activation>
<properties>
<npn.version>1.1.6.v20130911</npn.version>
</properties>
</profile>
<profile>
<id>7u45</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_45</value>
</property>
</activation>
<properties>
<npn.version>1.1.6.v20130911</npn.version>
</properties>
</profile>
<profile>
<id>7u51</id>
<activation>
<property>
<name>java.version</name>
<value>1.7.0_51</value>
</property>
</activation>
<properties>
<npn.version>1.1.6.v20130911</npn.version>
</properties>
</profile>
</profiles>
</project>

View File

@ -41,6 +41,10 @@ import static java.util.concurrent.TimeUnit.*;
* coordinates org.mortbay.jetty.npn:npn-boot. Different versions applies to different OpenJDK versions. See
* <a href="http://www.eclipse.org/jetty/documentation/current/npn-chapter.html">Jetty docs</a> for more information.
* <p>
* You may also use maven to start the client from the command line:
* <pre>
* mvn exec:exec -Pspdy-client
* </pre>
*/
public class SpdyClient {

View File

@ -32,6 +32,13 @@
* <p>
* After that, you can run {@link io.netty.example.spdy.client.SpdyClient}, also settings the JVM parameter
* mentioned above.
* <p>
* You may also use maven to start the server and the client from the command line:
* <pre>
* mvn exec:exec -Pspdy-server
* </pre>
* Then start the client in a different terminal window:
* mvn exec:exec -Pspdy-client
*/
package io.netty.example.spdy.client;

View File

@ -31,6 +31,11 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
* See <a href="http://www.eclipse.org/jetty/documentation/current/npn-chapter.html">Jetty docs</a> for more
* information.
* <p>
* You may also use maven to start the server from the command line:
* <pre>
* mvn exec:exec -Pspdy-server
* </pre>
* <p>
* Once started, you can test the server with your
* <a href="http://en.wikipedia.org/wiki/SPDY#Browser_support_and_usage">SPDY enabled web browser</a> by navigating
* to https://localhost:8443/.

View File

@ -28,6 +28,11 @@
* See <a href="http://www.eclipse.org/jetty/documentation/current/npn-chapter.html">Jetty docs</a> for more
* information.
* <p>
* You may also use maven to start the server from the command line:
* <pre>
* mvn exec:exec -Pspdy-server
* </pre>
* <p>
* Once started, you can test the server with your
* <a href="http://en.wikipedia.org/wiki/SPDY#Browser_support_and_usage">SPDY enabled web browser</a> by navigating
* to <a href="https://localhost:8443/">https://localhost:8443/</a>