Maven 2.x Webstart Plugin

support running the webstart:jnlp plugin alongside a normal pom, without having to use multiprojects

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-alpha-2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

Today, you cannot do something like

mvn install webstart:jnlp

hoping that your freshly installed artifact gets packaged into your jnlp artifact. The reason, I didn't think it was necessary because of the one artifact one module rule. If you feel otherwise, please vote on this issue.

  1. MWEBSTART-13.diff
    02/Jan/07 3:39 PM
    92 kB
    Jerome Lacoste
  2. MWEBSTART-13.diff
    02/Jan/07 9:31 AM
    78 kB
    Jerome Lacoste

Activity

Hide
Holger Brands added a comment -

I was surprised to see, that the webstart plugin requires me to create a separate maven project.
The "one project - one artefact" rule is an argument, but a weak one in this case, I think.
For example, I can create a source jar (=artifact ?!) with "mvn source:jar" from my existing project without the need to create a separate project. I think, it's reasonable to support such "derived artifacts" in one project.
So, for simplicity and practical reasons I would like to see a fix for this issue
Thanks.

Show
Holger Brands added a comment - I was surprised to see, that the webstart plugin requires me to create a separate maven project. The "one project - one artefact" rule is an argument, but a weak one in this case, I think. For example, I can create a source jar (=artifact ?!) with "mvn source:jar" from my existing project without the need to create a separate project. I think, it's reasonable to support such "derived artifacts" in one project. So, for simplicity and practical reasons I would like to see a fix for this issue Thanks.
Hide
Jerome Lacoste added a comment -

The thing is that your source jar is not normally an artifact of your build process, i.e. you don't need it to run your final program, while your webstart artifact is required for your application to work.

I can still see a use case for small applications in particular.

Show
Jerome Lacoste added a comment - The thing is that your source jar is not normally an artifact of your build process, i.e. you don't need it to run your final program, while your webstart artifact is required for your application to work. I can still see a use case for small applications in particular.
Hide
Holger Brands added a comment -

While I tend to agree, that a source jar and the webstart packaging is not the same, the webstart artifact is not always required.
For example you can create an assembly of a client app and install and use it locally without webstart.

Perhaps you can think about webstart packaging as another kind of distribution package. The main artifact of the project (the JAR)
is distributed as webstart application. It logically belongs to this project (the required dependencies and some other metadata
are already defined there).
Besides, you already can create other distributions with the assembly plugin from within the project.

Consider a real world client server application as multi-project build:

  • one module for the server
  • three modules for three different client applications talking to the server
  • a few other modules with shared components

Now, you want to create three webstart applications for the three client apps.
As I understand it now, I would have to create three additional modules for the three webstart packages.
This is doable, but seems to be too complex ...

Show
Holger Brands added a comment - While I tend to agree, that a source jar and the webstart packaging is not the same, the webstart artifact is not always required. For example you can create an assembly of a client app and install and use it locally without webstart. Perhaps you can think about webstart packaging as another kind of distribution package. The main artifact of the project (the JAR) is distributed as webstart application. It logically belongs to this project (the required dependencies and some other metadata are already defined there). Besides, you already can create other distributions with the assembly plugin from within the project. Consider a real world client server application as multi-project build:
  • one module for the server
  • three modules for three different client applications talking to the server
  • a few other modules with shared components
Now, you want to create three webstart applications for the three client apps. As I understand it now, I would have to create three additional modules for the three webstart packages. This is doable, but seems to be too complex ...
Hide
Craig Sumner added a comment -

Our intended use of this plugin is very analogous to our use of the assembly plugin. I approched it in the same way, and ended up spending way too long finding this solution.

Show
Craig Sumner added a comment - Our intended use of this plugin is very analogous to our use of the assembly plugin. I approched it in the same way, and ended up spending way too long finding this solution.
Hide
Jerome Lacoste added a comment -

I would like to fix this and would appreciate your input.

Here's a very rough/untested patch that tries to address the issue.

I modelled the change after the current design of the assembly plugin.

The assembly plugin seems to need to have 3 mojos defined to cover various cases. E.g. for the directory goal: directory, directory-inline, directory-single. The third one differs from the first by removing the specified @phase and using the project instead of executedProject instead.
The second one differs from the third by removing the @aggregator tag.

http://maven.apache.org/plugins/maven-assembly-plugin/

So if I want to support something similar in jnlp, we can try the following attached patch.

2 words of caution:

  • not sure if I need to move the workDirectory definition out of the abstract class (because the default value comes from project.build.... and I am not sure this one is defined in the jnlp:jnlp mojo (that now uses executedProject instead of project)
  • I've added @aggregator to the default jnlp mojo. I am not sure if that one will have an impact or not on your builds. Is so you may need to use the jnlp-inline instead

Anyone wants to give this patch a try ?

Show
Jerome Lacoste added a comment - I would like to fix this and would appreciate your input. Here's a very rough/untested patch that tries to address the issue. I modelled the change after the current design of the assembly plugin. The assembly plugin seems to need to have 3 mojos defined to cover various cases. E.g. for the directory goal: directory, directory-inline, directory-single. The third one differs from the first by removing the specified @phase and using the project instead of executedProject instead. The second one differs from the third by removing the @aggregator tag. http://maven.apache.org/plugins/maven-assembly-plugin/ So if I want to support something similar in jnlp, we can try the following attached patch. 2 words of caution:
  • not sure if I need to move the workDirectory definition out of the abstract class (because the default value comes from project.build.... and I am not sure this one is defined in the jnlp:jnlp mojo (that now uses executedProject instead of project)
  • I've added @aggregator to the default jnlp mojo. I am not sure if that one will have an impact or not on your builds. Is so you may need to use the jnlp-inline instead
Anyone wants to give this patch a try ?
Hide
Jerome Lacoste added a comment -

Updated version of the patch.

  • fixed a small issue (replaced @phase with @execute phase=, otherwise the executedProject property is not filled by plexus (WHY????))
  • manually tested 2 goals: jnlp and jnlp-inline. The first works in the case of
    mvn install webstart-jnlp
    the second is used when the jnlp-inline goal is attached to the package phase in the pom and mvn install does the jarring and the jnlp then install boths

I need to do the doc then (and i need to replace those manual tests with some functional tests as done in the assembly plugin). Would still appreciate someone to test for this...

Show
Jerome Lacoste added a comment - Updated version of the patch.
  • fixed a small issue (replaced @phase with @execute phase=, otherwise the executedProject property is not filled by plexus (WHY????))
  • manually tested 2 goals: jnlp and jnlp-inline. The first works in the case of mvn install webstart-jnlp the second is used when the jnlp-inline goal is attached to the package phase in the pom and mvn install does the jarring and the jnlp then install boths
I need to do the doc then (and i need to replace those manual tests with some functional tests as done in the assembly plugin). Would still appreciate someone to test for this...
Hide
Jerome Lacoste added a comment -

I checked in the patch with little changes (remove the @phase tags on the 2 new mojos) and released a snapshot ( 1.0-alpha-2-20070103.203758-1 )

Please test. I will now work on functional tests when I get some time.

Show
Jerome Lacoste added a comment - I checked in the patch with little changes (remove the @phase tags on the 2 new mojos) and released a snapshot ( 1.0-alpha-2-20070103.203758-1 ) Please test. I will now work on functional tests when I get some time.
Hide
Wim Deblauwe added a comment -

Where can I find the snapshot to test?

Show
Wim Deblauwe added a comment - Where can I find the snapshot to test?
Hide
Jerome Lacoste added a comment -
Show
Jerome Lacoste added a comment - > Where can I find the snapshot to test? http://snapshots.repository.codehaus.org/org/codehaus/mojo/webstart-maven-plugin-parent/
Hide
Wim Deblauwe added a comment -

Hi Jerome,

I tested the plugin and it works fine. I am using it with just static html. I am currently facing 2 minor issues:

  • When staging the site, the "codebase" attribute is incorrect. I have to change it manually and then change it back when doing the real deploy.
  • I have to output everything into my src/site/resources directory, otherwise, the maven site plugin does not copy the jnlp file and the jar files to the website.

If you have solutions for either one of these, please let me know.

Show
Wim Deblauwe added a comment - Hi Jerome, I tested the plugin and it works fine. I am using it with just static html. I am currently facing 2 minor issues:
  • When staging the site, the "codebase" attribute is incorrect. I have to change it manually and then change it back when doing the real deploy.
  • I have to output everything into my src/site/resources directory, otherwise, the maven site plugin does not copy the jnlp file and the jar files to the website.
If you have solutions for either one of these, please let me know.
Hide
Jerome Lacoste added a comment -

> When staging the site, the "codebase" attribute is incorrect. I have to change it manually and then change it back when doing the real deploy.
> I have to output everything into my src/site/resources directory, otherwise, the maven site plugin does not copy the jnlp file and the jar files to the website.

Wim,

I am confused here. Are you talking of the site plugin or the webstart plugin ? Do you expect the plugin to move the generated webstart into your site ? I've never used it like that. Can we move this talk on the mojo user list ?

Show
Jerome Lacoste added a comment - > When staging the site, the "codebase" attribute is incorrect. I have to change it manually and then change it back when doing the real deploy. > I have to output everything into my src/site/resources directory, otherwise, the maven site plugin does not copy the jnlp file and the jar files to the website. Wim, I am confused here. Are you talking of the site plugin or the webstart plugin ? Do you expect the plugin to move the generated webstart into your site ? I've never used it like that. Can we move this talk on the mojo user list ?
Hide
Wim Deblauwe added a comment -
Show
Wim Deblauwe added a comment - Tested and works (see http://vigilog.sourceforge.net/staging/)

People

Vote (5)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: