You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jerome lacoste <je...@gmail.com> on 2005/10/20 06:26:54 UTC

Guidance on combining resulting artifacts from several invocation of a plugin that produces many files

[Hoping that cross posting on both lists is not an issue]

First congrats to all of you for yesterday's release.

I am getting closer to have a working webstart-maven-plugin and need
some input from experienced m2 developers.

The webstart plugin does the following work:

- generate a jnlp file
- copy the jars marked as dependencies into a working directory
- sign the jars using an existing or created keystore file
- automatically add a jnlp-servlet.jar when working in a web environment
- if required, use pack200 algorythm to create packed and packed
gzipped versions of the jars.

In the future it will also generate other files (version.xml),
index.html, etc...

All these operations happen in a working repository where the layout
is correctly created.

All in all it's a plugin that does quite a few things. The main
resulting artifact is the jnlp file, but the jnlp file without the
signed/packed/zipped jar is not that interesting.

If I use the webstart plugin in a project, I am assuming that the
install operation will only install the jnlp file, and not the full
working directory, right?

Right now I've focused on producing the results for a single module.
Now I need to be able to combine several modules that generate the
aforementionned artifacts. Most of the time these modules will be
combined in a web application.

Example: with the following 3 modules:

webstart1 - configured to execute webstart
webstart2 - configured to execute webstart
webapp - creates a war, adds the webstart1 and webstart2 artifacts

(last module could be split in 2:
 create a war
 combine war + webstart1 + webstart2.
 To keep it simple I assume that this happens in one module)


Questions:
1- If only the jnlp file was deployed, how do I get hold of the rest
of the generated files. They are still in the working repository, but
my webapp project doesn't know it, or does it?
    If the other artifacts are deployed, what is the appropriate
resulting artifact? a zip?

2- Should I and if so how can I share the working directory between
webstart1 and webstart2 so that operations on identical files are not
reproduced (e.g. if both webstart modules must sign & pack the same
dependency, better to do the operation only once)

3- Should the merging of the generated files happen automatically?
e.g. assuming that all artifacts are installed in the local
repository, if a user specifies a 'jnlp-zip' dependency type in the
webapp pom, the war plugin could automatically search for the set of
artifacts and combine it automatically into its resulting war? Or
should that be a manual operation, i.e. the user must specify and
configure a <plugin> to perform this merging, maybe using the assmbly
?

Any idea that you have that could help me make this work the maven way
is appreciated..

Review of current specification in [1] is appreciated.

Cheers,

Jerome

[1] http://docs.codehaus.org/display/MOJO/Webstart+Plugin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Guidance on combining resulting artifacts from several invocation of a plugin that produces many files

Posted by Brett Porter <br...@apache.org>.
jerome lacoste wrote:

> Now it's a zip file. I've modified it to allow zipping the full
> contents of the directory that contains the produced artifacts.
> 

ok, I'll take a look at that.

> 
>>Incidentally, the License for JNLPServlet has that nuclear facility
>>clause. I'm not sure that package is entirely licensed as BSD and would
>>require further investigation before inclusion.
> 
> 
> The Mustang JNLP is the one I am talking about. Not the SDK 5.0.
> Are we looking at the same one?

I was looking at the one on the wiki...

> Now it's the responsibility of the user to include the jnlp servlet.

Cool.

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Guidance on combining resulting artifacts from several invocation of a plugin that produces many files

Posted by jerome lacoste <je...@gmail.com>.
> The Mustang JNLP is the one I am talking about. Not the SDK 5.0.
> Are we looking at the same one?
>
> > grep -i nuclear /tmp/jdk6.0-b56/deploy/src/javaws/share/sample/servlet/
> >
>

with a -r, it indeed finds the nuclear...

I will think about doing something with that...

I should maybe open an issue on Sun Issue tracker.

Here's some other related threads:
http://mail-archives.apache.org/mod_mbox/www-legal-discuss/200509.mbox/%3c4321A7B5.2040208@apache.org%3e
http://www.monkey.org/openbsd/archive/misc/0503/msg00053.html

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Guidance on combining resulting artifacts from several invocation of a plugin that produces many files

Posted by jerome lacoste <je...@gmail.com>.
On 10/24/05, Brett Porter <br...@apache.org> wrote:
> jerome lacoste wrote:
> > [Hoping that cross posting on both lists is not an issue]
>
> Would rather not. Everyone on mojo-dev should be on maven-dev, I think.
>
> > First congrats to all of you for yesterday's release.
>
> Thanks! Sorry for the delayed response.

hangover recovery I would guess :)

> > If I use the webstart plugin in a project, I am assuming that the
> > install operation will only install the jnlp file, and not the full
> > working directory, right?
>
> That's what would be expected, the main product of the build is the jnlp
> file, and nothing else?

Now it's a zip file. I've modified it to allow zipping the full
contents of the directory that contains the produced artifacts.

[...]
> This still seems a little problematic to me - I'd like to understand it
> more. I don't quite get that from the wiki page.

thanks for your answer. I changed my design to make the webstart
plugin produce and install a zip file which I need to merge into the
war file. I raised another thread for that (related to MNG-1274) to
which you already answered.

> Incidentally, the License for JNLPServlet has that nuclear facility
> clause. I'm not sure that package is entirely licensed as BSD and would
> require further investigation before inclusion.

The Mustang JNLP is the one I am talking about. Not the SDK 5.0.
Are we looking at the same one?

> grep -i nuclear /tmp/jdk6.0-b56/deploy/src/javaws/share/sample/servlet/
>




> Should this be phased to do what the m1 plugin does, then include the
> servlet stuff later on?

Now it's the responsibility of the user to include the jnlp servlet.

Thanks for your answers

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Guidance on combining resulting artifacts from several invocation of a plugin that produces many files

Posted by Brett Porter <br...@apache.org>.
jerome lacoste wrote:
> [Hoping that cross posting on both lists is not an issue]

Would rather not. Everyone on mojo-dev should be on maven-dev, I think.

> First congrats to all of you for yesterday's release.

Thanks! Sorry for the delayed response.

> If I use the webstart plugin in a project, I am assuming that the
> install operation will only install the jnlp file, and not the full
> working directory, right?

That's what would be expected, the main product of the build is the jnlp 
file, and nothing else?

> webapp - creates a war, adds the webstart1 and webstart2 artifacts

This will require a fix for the webapp plugin to copy deps somewhere 
other than WEB-INF/lib, required for applets as well. There is an open 
jira ticket already.

>  combine war + webstart1 + webstart2.
>  To keep it simple I assume that this happens in one module)

I'm not sure what you mean here. It looks like 3 modules, with the war 
depending on the other 2 and including them?

> 1- If only the jnlp file was deployed, how do I get hold of the rest
> of the generated files. They are still in the working repository, but
> my webapp project doesn't know it, or does it?

No, the WAR won't know about it. What information does it need from that 
directory that it can't get from the JNLP file?

>     If the other artifacts are deployed, what is the appropriate
> resulting artifact? a zip?

It will really depend on what they are and how they are used. I need to 
understand more about it.

> 2- Should I and if so how can I share the working directory between
> webstart1 and webstart2 so that operations on identical files are not
> reproduced (e.g. if both webstart modules must sign & pack the same
> dependency, better to do the operation only once)

Currently, m2 doesn't delve into that in any way. Remember, a module 
should build on its own if possible.

One option is to redo it each time and take the performance hit, the 
other is to deploy the modified dependency into the repository and 
depend on that, however you can't really do that if you aren't building 
the dependency originally.

I guess you could use a shared component that is only instantiated once 
and cache the location of generated files so that it is only done once 
in the reactor and perhaps can find them across builds, but you'll need 
to look after that logic and make sure it gets flushed appropriately and 
still works if one project is built in isolation. We're definitely 
slating improvements in this area in future versions to further improve 
performance from m2.

Of course, I may be misunderstanding this. If these all share one source 
tree and the three are built from a single module obviously its a 
different story.

> 
> 3- Should the merging of the generated files happen automatically?
> e.g. assuming that all artifacts are installed in the local
> repository, if a user specifies a 'jnlp-zip' dependency type in the
> webapp pom, the war plugin could automatically search for the set of
> artifacts and combine it automatically into its resulting war? Or
> should that be a manual operation, i.e. the user must specify and
> configure a <plugin> to perform this merging, maybe using the assmbly
> ?

This still seems a little problematic to me - I'd like to understand it 
more. I don't quite get that from the wiki page.

Incidentally, the License for JNLPServlet has that nuclear facility 
clause. I'm not sure that package is entirely licensed as BSD and would 
require further investigation before inclusion.

Should this be phased to do what the m1 plugin does, then include the 
servlet stuff later on?

HTH,
Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org