evenisse    2004/01/29 04:00:44

  Modified:    jnlp     plugin.jelly
               jnlp/xdocs changes.xml
  Log:
  MPJNLP-4. Add support for jar versions
  
  Revision  Changes    Path
  1.20      +74 -10    maven-plugins/jnlp/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jnlp/plugin.jelly,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- plugin.jelly      7 Jan 2004 16:03:55 -0000       1.19
  +++ plugin.jelly      29 Jan 2004 12:00:44 -0000      1.20
  @@ -33,15 +33,17 @@
           <!-- ================== -->
           <!-- Generate JNLP file -->
           <!-- ================== -->
  +             <maven:property name="maven.jnlp.description" 
defaultValue="${pom.description}"/>
  +             <maven:property name="maven.jnlp.description.short" 
defaultValue="${pom.shortDescription}"/>
  +             <maven:property name="maven.jnlp.http.codebase" 
defaultValue="${pom.url}"/>
  +             <maven:property name="maven.jnlp.signjar.alias" 
defaultValue="${pom.artifactId}"/>
  +             <maven:property name="maven.jnlp.signjar.dname.o" 
defaultValue="${pom.organization.name}"/>
  +             <maven:property name="maven.jnlp.title" defaultValue="${pom.name}"/>
  +             <j:set var="final.jar.name" value="${maven.final.name}.jar"/>
  +        
           <j:file name="${maven.jnlp.dir}/${pom.artifactId}.jnlp" prettyPrint="true"
             xmlns="dummy">
   
  -            <maven:property name="maven.jnlp.description" 
defaultValue="${pom.description}"/>
  -            <maven:property name="maven.jnlp.description.short" 
defaultValue="${pom.shortDescription}"/>
  -            <maven:property name="maven.jnlp.http.codebase" 
defaultValue="${pom.url}"/>
  -            <maven:property name="maven.jnlp.signjar.alias" 
defaultValue="${pom.artifactId}"/>
  -            <maven:property name="maven.jnlp.signjar.dname.o" 
defaultValue="${pom.organization.name}"/>
  -            <maven:property name="maven.jnlp.title" defaultValue="${pom.name}"/>
   
               <jnlp spec="${maven.jnlp.spec}"
                 codebase="${maven.jnlp.http.codebase}"
  @@ -98,11 +100,25 @@
                           <j:if test="${dep.getProperty('jnlp.jar')=='true'}">
                               <j:choose>
                                 <j:when 
test="${dep.getProperty('jnlp.main.jar')=='true'}">
  -                                 <j:set var="mainExists" value="true"/>
  +                                <j:set var="mainExists" value="true"/>
  +                                                             <j:choose>
  +                                                               <j:when 
test="${context.getVariable('maven.jnlp.usejarversions') != null}">
  +                                                                     <jar 
href="${lib.file.name}" main="true" version="${dep.version}"/>
  +                                                               </j:when>
  +                                                               <j:otherwise>
                                     <jar href="${lib.file.name}" main="true"/>
  +                                                               </j:otherwise>
  +                                                             </j:choose>
                                 </j:when>
                                 <j:otherwise>
  -                                  <jar href="${lib.file.name}"/>
  +                                <j:choose>
  +                                       <j:when 
test="${context.getVariable('maven.jnlp.usejarversions') != null}">
  +                                    <jar href="${lib.file.name}" 
version="${dep.version}"/>
  +                                  </j:when>
  +                                  <j:otherwise>
  +                                    <jar href="${lib.file.name}" />
  +                                  </j:otherwise>
  +                                </j:choose>
                                 </j:otherwise>
                               </j:choose>
                           </j:if>
  @@ -112,10 +128,24 @@
                       </j:forEach>
                       <j:choose>
                           <j:when test="${mainExists=='false'}">
  -                            <jar href="${maven.final.name}.jar" main="true"/>
  +                                                     <j:choose>
  +                                                       <j:when 
test="${context.getVariable('maven.jnlp.usejarversions') != null}">
  +                                                             <jar 
href="${final.jar.name}" main="true" version="${pom.currentVersion}"/>
  +                                                       </j:when>
  +                                                       <j:otherwise>
  +                                <jar href="${final.jar.name}" main="true"/>
  +                                                       </j:otherwise>
  +                                                     </j:choose>
                           </j:when>
                           <j:otherwise>
  -                            <jar href="${maven.final.name}.jar"/>
  +                                                     <j:choose>
  +                                                       <j:when 
test="${context.getVariable('maven.jnlp.usejarversions') != null}">
  +                                                             <jar 
href="${final.jar.name}" version="${pom.currentVersion}"/>
  +                                                       </j:when>
  +                                                       <j:otherwise>
  +                                <jar href="${final.jar.name}" />
  +                                                       </j:otherwise>
  +                                                     </j:choose>
                           </j:otherwise>
                       </j:choose>
                       <!--  This is close to what it WILL look like, but for now it 
is the ugly ass thing below  it-->
  @@ -152,6 +182,40 @@
                   </j:choose>
               </jnlp>
           </j:file>
  +        
  +        <j:if test="${context.getVariable('maven.jnlp.usejarversions') != null}">
  +        
  +                     <ant:echo>Creating ${maven.jnlp.dir}/version.xml ...</ant:echo>
  +     
  +                     <!-- ================== -->
  +                     <!-- Generate version.xml file -->
  +                     <!-- ================== -->
  +                     <j:file name="${maven.jnlp.dir}/version.xml" prettyPrint="true"
  +                       xmlns="dummy">
  +                        <jnlp-versions>  
  +                             <j:forEach var="lib" items="${pom.artifacts}">
  +                                     <j:set var="dep" value="${lib.dependency}"/>
  +                                     <j:if 
test="${dep.getProperty('jnlp.jar')=='true' || 
dep.getProperty('jnlp.native.jar')=='true'}">
  +                                       <resource>  
  +                                        <pattern>  
  +                                              <name>${lib.file.name}</name>  
  +                                              
<version-id>${dep.version}</version-id>  
  +                                        </pattern>  
  +                                        <file>${lib.file.name}</file>  
  +                                       </resource>  
  +                                     </j:if>
  +                             </j:forEach>
  +                                       <resource>  
  +                                        <pattern>  
  +                                              <name>${final.jar.name}</name>  
  +                                              
<version-id>${pom.currentVersion}</version-id>  
  +                                        </pattern>  
  +                                        <file>${final.jar.name}</file>  
  +                                       </resource>  
  +                        </jnlp-versions>
  +                     </j:file>
  +             </j:if>
  +        
           
           <!-- =========================== -->
           <!-- Copy jars in jnlp directory -->
  
  
  
  1.8       +3 -0      maven-plugins/jnlp/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jnlp/xdocs/changes.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- changes.xml       7 Jan 2004 12:10:10 -0000       1.7
  +++ changes.xml       29 Jan 2004 12:00:44 -0000      1.8
  @@ -8,6 +8,9 @@
   
     <body>
       <release version="1.3" date="In CVS">
  +      <action dev="evenisse" type="fix">
  +        MPJNLP-4. Add support for jar versions
  +      </action>
         <action dev="jvanzyl" type="update">
           Remove the need for ${pom} interpolation in properties. The
           use of the maven:property tag is now used to glean a default property.
  
  
  

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

Reply via email to