Skip to content

Commit d35f7d0

Browse files
dcassianizhendrikse
authored andcommitted
BAEL-388 (eugenp#1360)
* initial push * module Java Web Start (jws) add * pom improvements and fixes
1 parent 202a19a commit d35f7d0

9 files changed

Lines changed: 155 additions & 0 deletions

File tree

‎jws/.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/target/
2+
.classpath
3+
.project
4+
.settings
5+
/.settings/
6+
/settings/
7+
.tern-project
11.1 KB
Binary file not shown.
53.7 KB
Binary file not shown.

‎jws/pom.xml‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.example</groupId>
6+
<artifactId>jws</artifactId>
7+
<packaging>war</packaging>
8+
<version>0.0.1-SNAPSHOT</version>
9+
10+
<name>jws-example</name>
11+
12+
<properties>
13+
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
14+
<maven-war-plugin.version>3.0.0</maven-war-plugin.version>
15+
<jardiff.version>7.0</jardiff.version>
16+
<jnlp-servlet.version>7.0</jnlp-servlet.version>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>javax.jnlp</groupId>
22+
<artifactId>jnlp-servlet</artifactId>
23+
<version>${jnlp-servlet.version}</version>
24+
<scope>system</scope>
25+
<systemPath>${project.basedir}/java-core-samples-lib/jnlp-servlet.jar</systemPath>
26+
</dependency>
27+
<dependency>
28+
<groupId>javax.jnlp</groupId>
29+
<artifactId>jardiff</artifactId>
30+
<version>${jardiff.version}</version>
31+
<scope>system</scope>
32+
<systemPath>${project.basedir}/java-core-samples-lib/jardiff.jar</systemPath>
33+
</dependency>
34+
35+
</dependencies>
36+
37+
<build>
38+
<plugins>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-jar-plugin</artifactId>
42+
<version>${maven-jar-plugin.version}</version>
43+
<executions>
44+
<execution>
45+
<phase>compile</phase>
46+
<goals>
47+
<goal>jar</goal>
48+
</goals>
49+
<configuration>
50+
<archive>
51+
<manifest>
52+
<mainClass>com.example.Hello</mainClass>
53+
</manifest>
54+
</archive>
55+
<outputDirectory>${project.basedir}/target/jws</outputDirectory>
56+
</configuration>
57+
</execution>
58+
</executions>
59+
</plugin>
60+
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-war-plugin</artifactId>
64+
<version>${maven-war-plugin.version}</version>
65+
<executions>
66+
<execution>
67+
<phase>package</phase>
68+
</execution>
69+
</executions>
70+
<configuration>
71+
<webResources>
72+
<resource>
73+
<directory>${project.basedir}/java-core-samples-lib/</directory>
74+
<includes>
75+
<include>**/*.jar</include>
76+
</includes>
77+
<targetPath>WEB-INF/lib</targetPath>
78+
</resource>
79+
</webResources>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
<finalName>${project.artifactId}</finalName>
84+
</build>
85+
86+
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example;
2+
3+
import javax.swing.*;
4+
5+
public class Hello {
6+
public static void main(String[] args) {
7+
JFrame f = new JFrame("main");
8+
f.setSize(200, 100);
9+
f.setLocationRelativeTo(null);
10+
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
11+
JLabel label = new JLabel("Hello, world!");
12+
f.add(label);
13+
f.setVisible(true);
14+
}
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE web-app
2+
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3+
"http://java.sun.com/dtd/web-app_2_3.dtd">
4+
<web-app>
5+
<display-name>Java Web Start</display-name>
6+
<description>JNLP Example for Java Web Start Article</description>
7+
8+
<servlet>
9+
<servlet-name>JnlpDownloadServlet</servlet-name>
10+
<servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>
11+
</servlet>
12+
<servlet-mapping>
13+
<servlet-name>JnlpDownloadServlet</servlet-name>
14+
<url-pattern>*.jar</url-pattern>
15+
</servlet-mapping>
16+
<servlet-mapping>
17+
<servlet-name>JnlpDownloadServlet</servlet-name>
18+
<url-pattern>*.jnlp</url-pattern>
19+
</servlet-mapping>
20+
21+
<welcome-file-list>
22+
<welcome-file>index.html</welcome-file>
23+
</welcome-file-list>
24+
</web-app>

‎jws/src/main/webapp/hello.jnlp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jnlp spec="1.0+" codebase="$$codebase">
3+
<information>
4+
<title>Hello</title>
5+
<vendor>Example</vendor>
6+
</information>
7+
<resources>
8+
<j2se version="1.2+"/>
9+
<jar href="jws.jar" main="true" />
10+
</resources>
11+
<application-desc/>
12+
</jnlp>

‎jws/src/main/webapp/index.html‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<title>Hello World JNLP</title>
4+
</head>
5+
<body>
6+
<p>
7+
<a href="hello.jnlp">Launch the example</a>
8+
</p>
9+
</body>
10+
</html>

‎pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<module>json</module>
7575
<module>jsoup</module>
7676
<module>junit5</module>
77+
<module>jws</module>
7778

7879
<module>kotlin</module>
7980

0 commit comments

Comments
 (0)