Completely untested patch. jerome.lacoste@gmail.com


Index: src/main/java/org/codehaus/mojo/webstart/JnlpMojo.java
===================================================================
--- src/main/java/org/codehaus/mojo/webstart/JnlpMojo.java	(revisión: 2875)
+++ src/main/java/org/codehaus/mojo/webstart/JnlpMojo.java	(copia de trabajo)
@@ -150,6 +150,13 @@
      *
      * @parameter
      */
+    private List nativeDependencies;
+
+    /**
+     * Xxx
+     *
+     * @parameter
+     */
     private SignConfig sign;
 
     public static class KeystoreConfig
@@ -341,10 +348,15 @@
     private FileFilter updatedPack200FileFilter = new CompositeFileFilter( pack200FileFilter, modifiedFileFilter );
 
     /**
-     * the artifacts packaged in the webstart app. *
+     * the non-native artifacts packaged in the webstart app
      */
     private List packagedJnlpArtifacts = new ArrayList();
 
+    /**
+     * the native artifacts packaged in the webstart app.
+     */
+    private List packagedJnlpNativeArtifacts = new ArrayList();
+
     private List modifiedJnlpArtifacts = new ArrayList();
 
     private Artifact artifactWithMainClass;
@@ -401,8 +413,7 @@
                     "didn't find artifact with main class: " + jnlp.getMainClass() + ". Did you specify it? " );
             }
 
-            // native libsi
-            // FIXME
+            // native libs
 
             /*
             for( Iterator it = getNativeLibs().iterator(); it.hasNext(); ) {
@@ -622,6 +633,8 @@
             filter.add( new ExcludesArtifactFilter( dependencies.getExcludes() ) );
         }
 
+        filter.add( new IncludesArtifactFilter( nativeDependencies ));
+
         Collection artifacts = getProject().getArtifacts();
 
         for ( Iterator it = artifacts.iterator(); it.hasNext(); )
@@ -672,8 +685,17 @@
 
                 }
 
-                packagedJnlpArtifacts.add( artifact );
+                // Filter out native dependencies ???
+                if ( new ExcludesArtifactFilter( nativeDependencies ).filter( artifact ) )
+                {
+                    packagedJnlpArtifacts.add( artifact );
+                }
+                else 
+                {
+                    packagedJnlpNativeArtifacts.add( artifact );
+                }
 
+
                 if ( artifactContainsClass( artifact, jnlp.getMainClass() ) )
                 {
                     if ( artifactWithMainClass == null )
@@ -1010,6 +1032,11 @@
         return packagedJnlpArtifacts;
     }
 
+    public List getPackagedJnlpNativeArtifacts()
+    {
+        return packagedJnlpNativeArtifacts;
+    }
+
     /*
     public Artifact getArtifactWithMainClass() {
         return artifactWithMainClass;
Index: src/main/resources/org/codehaus/mojo/webstart/template/jnlp.vm
===================================================================
--- src/main/resources/org/codehaus/mojo/webstart/template/jnlp.vm	(revisión: 2871)
+++ src/main/resources/org/codehaus/mojo/webstart/template/jnlp.vm	(copia de trabajo)
@@ -156,19 +156,14 @@
 #end
 #end
 ##
+#foreach($artifact in $config.packagedJnlpNativeArtifacts)
+    <nativelib href="${artifact.file.name}"/>
+#end
   </resources>
 ##
 ## END JNLP/RESOURCES/JAR
 ##
 ## ------------------------------
-## FIXME
-#foreach($jar in $config.expandedNativeLibs)
-  <resources #if($jar.os) os="${jar.os}" #end>
-    <nativelib href="${jar}"/>
-  </resources>
-#end
-##
-## ------------------------------
 ## JNLP/APPLICATION-DESC
 #if ( $config.jnlp.arguments )
   <application-desc main-class="${config.jnlp.mainClass}">
Index: src/site/apt/howto.apt
===================================================================
--- src/site/apt/howto.apt	(revisión: 2876)
+++ src/site/apt/howto.apt	(copia de trabajo)
@@ -133,6 +133,11 @@
              <excludes-->
            </dependencies>
 
+           <nativeDependencies>
+             <!-- Note that only groupId and artifactId must be specified here. because of a limitation of the Include/ExcludesArtifactFilter -->
+              <nativeDependency>mydlls:mydlls</nativeDependency>
+           </dependencies>
+
            <!-- JNLP generation -->
            <jnlp>
              <!-- default values -->

