I've added the following New Feature report on Jira:
http://jira.codehaus.org/browse/MPJNLP-8

Sun's JNLP Download Servlet has a neat feature for doing jar diffs, where they 
only give you the differences between various versions of a jar file. This 
can improve the download speeds immensely between updates. 
 
 The current of the jnlp plugin supports the versions.xml file which is used 
by the download servlet to map the jar files to specific version numbers. 
 
 However it is currently handled indirectly. Currently the jnlp file has the 
following for a dependency: 
 
 <jar version="1.4" href="dom4j-1.4.jar"> 
 </jar> 
 
 which is incorrect. It should have the following: 
 
 <jar version="1.4" href="dom4j.jar"> 
     </jar> 
 
 which allows the download servlet to find the jar file using the version.xml 
file. 
 
 The version.xml file also is incorrect (all be it it works with the above 
incorrect jnlp). Currently it generates the following: 
 
 <resource> 
     <pattern> 
       <name>dom4j-1.4.jar</name> 
       <version-id>1.4</version-id> 
     </pattern> 
     <file>dom4j-1.4.jar</file> 
   </resource> 
 
 What it should generate is the following: 
 
 <resource> 
     <pattern> 
       <name>dom4j.jar</name> 
       <version-id>1.4</version-id> 
     </pattern> 
     <file>dom4j-1.4.jar</file> 
   </resource> 
 
 This now leads us to the problem with autogenerating a version.xml file. This 
file needs to contain all the previous versions of each dependency. This 
could get very complex. 
 
 Thankfully there is a way around this. It is to use a naming based versioning 
scheme. Sun in their wisdom decided to invent a new one. However it is fairly 
easy to modify the current jnlp plugin to support it. 
 
 What happens is that we need to rename dom4-1.4.jar to dom4__V1.4.jar. Now 
when we deploy our updated app we just leave the old jar files where they are 
and the JNLP Download Servlet can calculate diffs based on it. 
 
 I've included diffs for doing it. All you need to do is place the following 
property in your project.properties: 
 
 maven.jnlp.jardiff=true 

Attached is the diff file as well as an updated binary jar file.

-P
-- 
http://talk.org      + Live and direct from Panama
http://neuclear.org  + The World Wide Web of Assets


? jnlpjardiff.diff
Index: plugin.jelly
===================================================================
RCS file: /home/cvspublic/maven-plugins/jnlp/plugin.jelly,v
retrieving revision 1.24
diff -r1.24 plugin.jelly
130a131,133
> 	                          <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (dep.version.indexOf('SNAPSHOT') lt 0)}">
>                                        <jar href="${dep.artifactId}.jar" main="true" version="${depVer}"/>
>                                   </j:when>
140a144,146
> 	                          <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (dep.version.indexOf('SNAPSHOT') lt 0)}">
>                                       <jar href="${dep.artifactId}.jar" version="${depVer}"/>
>                                   </j:when>
161a168,170
>                               <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (pom.currentVersion.indexOf('SNAPSHOT') lt 0)}">
>                                 <jar href="${pom.artifactId}.jar" main="true" version="${depVer}"/>
>                               </j:when>
171a181,183
>                               <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (pom.currentVersion.indexOf('SNAPSHOT') lt 0)}">
>                                 <jar href="${pom.artifactId}.jar" version="${depVer}"/>
>                               </j:when>
301a314,322
> 	    <j:choose>
>                 <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (pom.currentVersion.indexOf('SNAPSHOT') lt 0)}">
> 			<j:set var="maven.final.signedname" value="${pom.artifactId}__V${pom.currentVersion}.jar"/>
> 		</j:when>
> 		<j:otherwise>
> 		            <ant:echo>Not Using JarDiff ...</ant:echo>
> 			<j:set var="maven.final.signedname" value="${maven.final.name}.jar"/>
> 		</j:otherwise>
> 	    </j:choose>
304c325
<                 signedjar="${maven.jnlp.dir}/${maven.final.name}.jar"
---
>                 signedjar="${maven.jnlp.dir}/${maven.final.signedname}"
305a327
>                 storetype="${maven.jnlp.signjar.storetype}"
311a334,341
> 		<j:choose>
>                        <j:when test="${(context.getVariable('maven.jnlp.jardiff') != null) and (dep.version.indexOf('SNAPSHOT') lt 0)}">
> 				<j:set var="lib.file.signedname" value="${dep.artifactId}__V${dep.version}.jar"/>
> 			</j:when>
> 			<j:otherwise>
> 				<j:set var="lib.file.signedname" value="${lib.final.name}.jar"/>
> 			</j:otherwise>
> 		</j:choose>
314c344
<                   signedjar="${maven.jnlp.dir}/${lib.file.name}"
---
>                   signedjar="${maven.jnlp.dir}/${lib.file.signedname}"
315a346
>                   storetype="${maven.jnlp.signjar.storetype}"
323a355
>                   storetype="${maven.jnlp.signjar.storetype}"
Index: plugin.properties
===================================================================
RCS file: /home/cvspublic/maven-plugins/jnlp/plugin.properties,v
retrieving revision 1.5
diff -r1.5 plugin.properties
32a33
> ##maven.jnlp.jardiff=true
47c48
< 
---
> maven.jnlp.signjar.storetype=jks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to