* initial push

* module Java Web Start (jws) add

* pom improvements and fixes
This commit is contained in:
Daniel Cassiani 2017-03-19 08:44:00 -03:00 committed by Zeger Hendrikse
parent 202a19acbf
commit d35f7d01f7
9 changed files with 155 additions and 0 deletions

7
jws/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/target/
.classpath
.project
.settings
/.settings/
/settings/
.tern-project

Binary file not shown.

Binary file not shown.

86
jws/pom.xml Normal file
View File

@ -0,0 +1,86 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>jws</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>jws-example</name>
<properties>
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<maven-war-plugin.version>3.0.0</maven-war-plugin.version>
<jardiff.version>7.0</jardiff.version>
<jnlp-servlet.version>7.0</jnlp-servlet.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.jnlp</groupId>
<artifactId>jnlp-servlet</artifactId>
<version>${jnlp-servlet.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/java-core-samples-lib/jnlp-servlet.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.jnlp</groupId>
<artifactId>jardiff</artifactId>
<version>${jardiff.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/java-core-samples-lib/jardiff.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>com.example.Hello</mainClass>
</manifest>
</archive>
<outputDirectory>${project.basedir}/target/jws</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
</execution>
</executions>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/java-core-samples-lib/</directory>
<includes>
<include>**/*.jar</include>
</includes>
<targetPath>WEB-INF/lib</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

View File

@ -0,0 +1,15 @@
package com.example;
import javax.swing.*;
public class Hello {
public static void main(String[] args) {
JFrame f = new JFrame("main");
f.setSize(200, 100);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel("Hello, world!");
f.add(label);
f.setVisible(true);
}
}

View File

@ -0,0 +1,24 @@
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Java Web Start</display-name>
<description>JNLP Example for Java Web Start Article</description>
<servlet>
<servlet-name>JnlpDownloadServlet</servlet-name>
<servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JnlpDownloadServlet</servlet-name>
<url-pattern>*.jar</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JnlpDownloadServlet</servlet-name>
<url-pattern>*.jnlp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="$$codebase">
<information>
<title>Hello</title>
<vendor>Example</vendor>
</information>
<resources>
<j2se version="1.2+"/>
<jar href="jws.jar" main="true" />
</resources>
<application-desc/>
</jnlp>

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>Hello World JNLP</title>
</head>
<body>
<p>
<a href="hello.jnlp">Launch the example</a>
</p>
</body>
</html>

View File

@ -74,6 +74,7 @@
<module>json</module>
<module>jsoup</module>
<module>junit5</module>
<module>jws</module>
<module>kotlin</module>