[ 
http://jira.codehaus.org/browse/MWEBSTART-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_125722
 ] 

Kevin Stembridge commented on MWEBSTART-113:
--------------------------------------------

Hi Andreas,
Sounds like a good idea. 

Just a comment about the implementation though. I started out thinking that the 
{{JnlpDownloadServlet#buildHrefValue}} method would be a better place to put 
your logic regarding the hrefValue but then another idea popped up. The 
{{JarResource}} class should probably be responsible for producing the 
appropriate text to go in the JNLP file. So instead of the 
{{JarResourcesGenerator}} class asking the {{JarResource}} about itself, it 
just asks it for the text to be added to the JNLP.


So the {{JarResourcesGenerator#getDependenciesText}} would look something like 
this:

{code}
protected String getDependenciesText() {

    String jarResourcesText = "";
    
    if ( this.jarResources.size() != 0 )
    {
        
        StringBuffer buffer = new StringBuffer( 100 * this.jarResources.size() 
);
        buffer.append( "\n" );
         for ( Iterator itr = this.jarResources.iterator(); itr.hasNext(); )
        {
            JarResource jarResource = (JarResource) itr.next();
            
            if ( jarResource.isIncludeInJnlp() )
            {
                buffer.append(jarResource.getJnlpText();
                buffer.append("\n");
            }
            
    }
        
    return jarResourcesText;
 }
{code}



As for the {{Generator}} class, this doesn't use JarResources so it won't work 
for that class.

WDYT?

> SNAPSHOT-artifacts should be downloaded always
> ----------------------------------------------
>
>                 Key: MWEBSTART-113
>                 URL: http://jira.codehaus.org/browse/MWEBSTART-113
>             Project: Maven 2.x Webstart Plugin
>          Issue Type: Improvement
>          Components: jnlp-download-servlet
>    Affects Versions: 1.0-alpha-2
>            Reporter: Andreas Kuhtz
>         Attachments: pom.xml.diff
>
>
> I'm using version-download protocol. This works fine, however I found a 
> problem:
> If a SNAPSHOT-artifact is already downloaded you must always clean the cache 
> to have it downloaded again if the content was changed (--> new timestamp). 
> This is currently not the case but a small change can be applied that works. 
> I've attached a patch.
> If a SNAPSHOT-artifact is detected the jar-entry (<jar href="...) is 
> different than in normal case. See the output below. 
> {noformat}
> [...]
>   <resources>
>     <j2se version="1.6+"/>
>     <jar href="sample-client-appl-1.0-SNAPSHOT.jar" main="true"/>
>     <jar href="sample-domain-1.0-SNAPSHOT.jar"/>
>     <jar href="spring-aspects.jar" version="2.5.1"/>
> [...]
> {noformat} 
> The spring-aspects.jar is downloaded only once (independent of the timestamp 
> of the file). The 2 SNAPSHOT artifacts are downloaded if the timestamp of the 
> file is newer than the one in the cache.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to