Hi Andreas,
Can you confirm that you are using Sun's JnlpDownloadServlet? Could
you post the error you are getting?
You will probably notice that a file called version.xml is also
generated by the mojo in the same directory as the generated JNLP
file. This is used by Sun's Jnlp download servlet to map the incoming
request from the JNLP client (e.g. Webstart ) to the actual jar file
to be served up. Specifying the version number in a separate attribute
allows the download servlet to be a bit smarter about how it serves up
files. For example, it can create a jar diff between the version that
the client currently has and the version specified in the most
recently downloaded JNLP file.
Let me know if you have any more questions but I'll be offline for a
few days so I may not get back to you straight away.
Cheers,
Kevin
On Tue, Feb 19, 2008 at 1:53 AM, Kuhtz, Andreas
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using the webstart-maven-plugin (1.0-beta-1-SNAPSHOT) to create a WAR
> file with 2 jnlp files. The creation works but I've problems with the
> content of the generated jnlp-files:
> The jar-entries (<jar href="xxxx.jar" />) misses the version in the filename
> of the jar, e.g. log4j.jar instead of log4j-1.2.14.jar. Instead the version
> of the jar file is entered in a separate attribute version="1.12.14".
> When I try to load the JNLP files from Jetty or Tomcat I always get an
> error.
>
> I've changed the JnlpDownloadServletMojo.java to add the version to the
> filename and not to output the version of the jar in the JNLP file and this
> works for me. However I'd like to know how the current implementation (with
> the output of the version and the filename without the version) works ;-)
>
> See the changes to JnlpDownloadServletMojo.java below that works for me.
>
> Thanks,
> Andi
>
> --- C:\Documents and Settings\chakuht0\Local
> Settings\Temp\JnlpDownloadServletMojo.java-revBASE.svn000.tmp.java
> 2008-02-19 11:47:52.000000000 +-0100
> +++
> D:\virt\Java_Projects\webstart-maven-plugin\src\main\java\org\codehaus\mojo\webstart\JnlpDownloadServletMojo.java
> 2008-02-19 07:57:32.000000000 +-0100
> @@ -398,12 +399,13 @@
> {
> //for each configured JarResource, create and resolve the
> corresponding artifact and
> //check it for the mainClass if specified
> for ( Iterator itr = jarResources.iterator(); itr.hasNext(); )
> {
> JarResource jarResource = (JarResource) itr.next();
> + jarResource.setOutputJarVersion( /*true*/ false ); // kuz
> Artifact artifact = createArtifact(jarResource);
> getArtifactResolver().resolve( artifact,
> getRemoteRepositories(), getLocalRepository() );
> jarResource.setArtifact( artifact );
> checkForMainClass( jarResource );
> jarResourceArtifacts.add( artifact );
> }
> @@ -558,13 +560,13 @@
> // we should really improve the way we collect the jarResources
> if ( !jarResourceArtifacts.contains( resolvedArtifact ) )
> {
> JarResource newJarResource = new
> JarResource(resolvedArtifact);
> if ( !jarResources.contains( newJarResource ) )
> {
> - newJarResource.setOutputJarVersion( true );
> + newJarResource.setOutputJarVersion( /*true*/ false );
> // kuz
> jarResources.add( newJarResource );
> }
> }
>
> }
>
> @@ -685,12 +687,17 @@
> */
> private String buildHrefValue( Artifact artifact )
> {
> StringBuffer sbuf = new StringBuffer();
> sbuf.append( artifact.getArtifactId() );
>
> + if ( StringUtils.isNotEmpty( artifact.getVersion() ) )
> + {
> + sbuf.append( "-" ).append( artifact.getVersion() );
> + }
> +
> if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
> {
> sbuf.append( "-" ).append( artifact.getClassifier() );
> }
>
> sbuf.append( "." ).append(
> artifact.getArtifactHandler().getExtension() );
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email