Orangevolt ANT Tasks » Tasks » jnlp
An excurse about security in Java Web Startpreferences

2.3.9.  Example

Suppose the following directory structure of an application foo

/
  lib/
    foo.jar
    common.jar
    gui.jar
  native
    foo.dll

The following sample Ant build file creates a jnlp file using jnlp task:

<?xml version="1.0"?>  
 
<project basedir="." name="foo" default="main">
  <taskdef classpath="orangevolt-ant-tasks-1.3.2.jar" resource="com/orangevolt/tools/ant/taskdefs.properties"/>
    
  <target name="main">
    <jnlp toFile="foo.jnlp" href="foo.jnlp" codebase="http://www.foo.com/products/foo/jws-start">
      <information>
        <title>Foo</title>
        <vendor>Foo Bar Limited</vendor>
        <homepage href="http://www.foo.com/products/foo"/>
        <icon kind="splash" href="images/splash.gif"/>
        <icon href="logo.gif"/>
        <description>Foo is an extremely useful application for doing almost everything</description>
        <description kind="tooltip">Foo - the extremely useful application</description>
        <offline_allowed/>
      </information>
        
      <security>
     <all_permissions/>
      </security>
        
      <resources>
        <j2se version="1.4+"/>
        <fileset dir="." includes="**/*.jar, **/*.lib"/>
      </resources>
      <application_desc main_class="com.foo.Main"/>
    </jnlp>  
  </target>
</project>

The file set is expanded by the jnlp task and the matched resources are added to the generated jnlp file:

<jnlp href="foo.jnlp" codebase="http://www.foo.com/products/foo/jws-start">
  <information>
    <title>Foo</title>
    <vendor>Foo Bar Limited</vendor>
    <homepage href="http://www.foo.com/products/foo"/>
    <icon kind="splash" href="images/splash.gif"/>
    <icon href="logo.gif"/>
    <description>Foo is an extremely useful application for doing almost everything</description>
    <description kind="tooltip">Foo - the extremely useful application</description>
    <offline-allowed/>
  </information>
    
  <security>
      <all-permissions/>
  </security>
    
  <resources>
    <j2se version="1.4+"/>
    <jar href="lib/foo.jar"/>
    <jar href="lib/common.jar"/>
    <jar href="lib/gui.jar"/>
    <nativelib href="native/foo.dll"/>
  </resources>
  <application-desc main-class="com.foo.Main"/>
</jnlp>

As you can see, alle jar, dll and so files are added to the jnlp file.