Here is my maven project build with webstart
Quote:
<pluginRepositories>
<pluginRepository>
<id>maven-snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>common-gui</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>hal</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>jsapi</artifactId>
<version>1.2.1</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>freetts</artifactId>
<version>1.2.1</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>en_us</artifactId>
<version>1.2.1</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>cmudict04</artifactId>
<version>1.2.1</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>cmulex</artifactId>
<version>1.2.1</version>
<!--<scope>provided</scope> -->
</dependency>
<dependency>
<groupId>com.sun</groupId>
<artifactId>cmutimelex</artifactId>
<version>1.2.1</version>
<!--<scope>provided</scope> -->
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>
org.softlanding.hal.Hal9000
</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>jsapi</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>jsapi-1.2.1.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>freetts</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>freetts.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>en_us</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>en_us.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>en_us</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>en_us-1.2.1.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>cmulex</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>cmulex.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>cmutimelex</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>cmutimelex.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.sun</groupId>
<artifactId>cmu_us_kal</artifactId>
<version>1.2.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>cmu_us_kal.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>${pom.groupId}</groupId>
<artifactId>common-gui</artifactId>
<version>${pom.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>common-gui-${pom.version}.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>${pom.groupId}</groupId>
<artifactId>hal</artifactId>
<version>${pom.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${pom.name}-${pom.version}/dist</outputDirectory>
<destFileName>hal-${pom.version}.jar</destFileName>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.softlanding.hal.Hal9000</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.png</include>
<include>**/*.jpg</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
|
My project hiearchy has main/webapp/ where I have a jsp page.
Quote:
<html>
<head><SCRIPT LANGUAGE="JavaScript">
var javawsInstalled = 0;
var javaws142Installed=0;
var javaws150Installed=0;
isIE = "false";
if (navigator.mimeTypes && navigator.mimeTypes.length) {
x = navigator.mimeTypes['application/x-java-jnlp-file'];
if (x) {
javawsInstalled = 1;
javaws142Installed=1;
javaws150Installed=1;
}
}
else {
isIE = "true";
}
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
on error resume next
If isIE = "true" Then
If Not(IsObject(CreateObject("JavaWebStart.isInstalle d"))) Then
javawsInstalled = 0
Else
javawsInstalled = 1
End If
If Not(IsObject(CreateObject("JavaWebStart.isInstalle d.1.4.2.0"))) Then
javaws142Installed = 0
Else
javaws142Installed = 1
End If
If Not(IsObject(CreateObject("JavaWebStart.isInstalle d.1.5.0.0"))) Then
javaws150Installed = 0
Else
javaws150Installed = 1
End If
End If
</SCRIPT>
</head>
<a name="Quick Installation"></a><div class="section"><h2>Quick Installation</h2>
<p>This is a quick easy installing application, because it is a webstart enabled application. That means if you have the latest Java runtime (Java 1.5 or higher) installed on your
system; you should be able to run the application with one click on this page. If you see the Launch button click on it to automatically install otherwise follow the instructions to
install a Java runtime environment.</p>
<SCRIPT language="JavaScript">
/* Note that the logic below always launches the JNLP application
*if the browser is Gecko based. This is because it is not possible
*to detect MIME type application/x-java-jnlp-file on Gecko-based browsers.
*/
if (javawsInstalled || (navigator.userAgent.indexOf("Gecko") !=-1)) {
document.write("Install latest version of Heang 2000 <a href=heang-2000.jnlp><img src=webstart-button.gif></a>");
} else {
document.write("Click ");
document.write("<a href=http://java.sun.com/PluginBrowserCheck?pass=http://10.1.10.114:8080/index.jsp&fail=http://java.sun.com/j2se/1.5.0/download.html>here</a>");
document.write("to download and install JRE 5.0 and the application.");
}
</SCRIPT>
</p>
</div>
</html>
|
It references my webstart.jnpl file
To run my maven build I use mvn clean dependency:copy install
My JNLP file references jar dependencies in the war which should have been created in a directory inside the war called dist/somejarname.jar