Kenney, Stéphane,

Thanks for your answers! :o)

Indeed, the help page is valuable. The config to set the context-root works
well. :o)

As for the 'excluded' property, this may be helpful in some cases, but
IMHO, I'm not sure this is the good way to handle the problem. Indeed, a
War module usually have lots of depedencies, and :
- usually, you want to have most of them in the WEB-INF/lib of the War, not
in the Ear (for you may have singletons, for instance, that you don't want
to share between Wars)
- the 'excluded' property in this case is not handy because that means you
would have to do this (in the pom of the ear module) for every Jars you
want to exclude (and as I say, Web modules usually have lots of
dependencies). What's more, if you don't use the 'excluded' property, Jars
exist twice (one in the War and once in the Ear).

So I would say that the packaging for an Ear should be more complex
concerning the dependencies declared in its pom:
- for a Jar or an Ejb, then I agree that the transitive dependencies must
be included in the Ear
- for a War, the default behaviour should be to include only the War
itself, without all its transitive dependencies. There could be a property
'included' to tell the packager to take a specific dependency of the War
and put it up in the Ear. (this would be the opposite behaviour as
currently with the 'excluded' property)

What do you guys think of this? Is this relevant? If so, is this feasible?


Best Regards / Cordialement,
Fabrice BELLINGARD
DINQ/DSIN/INSI/EATE/IDVS/AIDV
(+33) (01 61) 45 15 91  -  [EMAIL PROTECTED]


                                                                       
             Stephane Nicoll                                           
             <stephane.nicoll                                          
             @gmail.com>                                              Pour
                                       Maven Users List                
             21/09/2005 08:58          <users@maven.apache.org>        
                                                                        cc
                                                                       
                 Veuillez                                            Objet
                répondre à             Re: Fw :[m2-beta-1] Ear plugin:
             Maven Users List          root-context & copied JARs/WARs 
             <[EMAIL PROTECTED]                                          
                 che.org>                                              
                                                                       
                                                                       
                                                                       
                                                                       




On 9/20/05, Kenney Westerhof <[EMAIL PROTECTED]> wrote:
> On Tue, 20 Sep 2005 [EMAIL PROTECTED] wrote:
>
> Hi,
>
>
> > Nobody has an answer for these 2 little questions?

Sorry, was quite busy yesterday.

> > 1- how can I tell the Ear plugin to use a specific root-context for a
War
> > when it generates the application.xml? (instead of using the
artifactId)
> > Something like the "<ear.appxml.war.context-root>" in m1.
>
> Use the plugin configuration. You can specify configuration options for
> the modules:
>
>   <modules>
>     <webModule>
>       <contextRoot>/yourContextRoot/</contextRoot>
>       <uri>the_web_uri</uri> <!-- if needed.. -->
>     </webModule>
>   </modules>
>
> Maybe Stephane Nicoll can confirm if this is correct?

It is except that you need of course to identify which artifact you
want to customize. There's an help page on the web site but it's not
linked properly :/

http://maven.apache.org/maven2/plugins/maven-ear-plugin/configuration-examples.html


You should find all usefull information there. We will fix the link for
beta2.

> > 2- when the plugin generates the Ear, it packages most dependencies of
the
> > War module, while they already exist the the WEB-INF/lib of the War
(and I
> > don't want them to be copied a second time at the root of the Ear).
Those
> > dependencies have a "compile" scope in the pom of the War module. Is it
the
> > normal behaviour? Is there a property or something to tell m2 not to
> > package them?
>
> Well this is a bit of a problem.
> You can specify the dependencies in the war pom with scope 'provided',
> so they won't end up in the war.
> This works great if you always use the war within an ear that also has
> those dependencies, but if you use that war standalone it'll break.
> Also, those war dependencies are not transferred to the ear project,
> so you have to respecify them there.

The link above explains the 'excluded' property you can set on an
artifact to ignore it application.xml generation. As kenny said, this
is indeed a bit of a problem. I'll think on that, do not hesitate to
ping us if you have ideas.

Cheers,
Stéphane

--
.::You're welcome ::.

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




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

Reply via email to