You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Graham Leggett <mi...@sharp.fm> on 2006/12/14 15:43:48 UTC
maven-ear-plugin and dependencies
Hi all,
Using the v2.3-SNAPSHOT version of the ear plugin, I am struggling to get
the application.xml file built correctly.
Between maven1 and maven2, the ejb plugin lost it's ability to bundle
dependencies inside the ejb.
This means (as I understand it) that it's now up to the ear plugin to add
all the dependencies to the application.xml file.
However, it seems that the maven-ear-plugin does not have any documented
functionality to add dependencies to application.xml, except for
explicitly declaring dependencies using the jarModule tag.
This duplicates the dependency list, and removes all the power behind
transitive dependency management, which is supposed to handle dependencies
for you.
Is there a setting I am not seeing, or does the ear plugin have no
dependency management features at all?
Regards,
Graham
--
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: maven-ear-plugin and dependencies
Posted by Garvin LeClaire <ga...@gmail.com>.
On 12/15/06, Graham Leggett <mi...@sharp.fm> wrote:
>
> On Thu, December 14, 2006 9:05 pm, Stephane Nicoll wrote:
>
> > This has been tackled a dozen of times and I am not sure it has
> > anything to do with the EAR plugin, at least if we follow the spec. If
> > I am wrong, please let me know.
> >
> > The valid way to bundle shared components/libs in a EAR is to define
> > the Class-Path entry of the manifest in EJB module(s) using the
> > component. It's certainly not by adding them in a <java> module entry
> > in the application.xml even though some application servers support
> > this (JBoss namely).
This where you make the spec compliant EJB jar by using the Class-Path
manifest entry as Stephane stated. The "trick" that BEA and IBM looks
similar to the spec for WAR but alas we do not have anything such thing for
EAR files.
All the things that various vendors are doing is a work around. This is
something that should be added to the JEE spec to make it cleaner in a
packaging as looking through EJB Jar files is nasty if one needs to debug.
>
> > The EAR plugin supports the APP-INF/lib weblogic's trick by using the
> > defaultJarBundleDir setting though.
> >
> > So I wouldn't say the EAR plugin has no dependency management features
> > at all, I don't even see the point actually :) Make sure that your
> > classpath entries got generated on the EJB side and it will just run
> > fine.
>
> Ok, then I'll put it this way: it has no dependency management features
> that are clearly enough documented :)
>
> If you create an ejb using the default ejb configuration, and then you add
> this ejb to an ear file again with a default configuration, maven goes
> through all the motions and creates what looks like a valid ear file.
>
> But this ear file refuses to load into Jboss (the dreaded NoClassDefFound
> exception).
>
> Is there a reason why a spec compliant ejb and ear can't be created by
> default by the ejb and ear plugins? I'm asking from ignorance - I don't
> have in depth knowledge of the internal structure of an ear file, that
> being maven's job to worry about this stuff for me.
>
> The only mention I can find about the classpath entry is a FAQ entry at
> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html, but this rather
> cryptic explanation doesn't indicate why you might want to do this
> (although it seems clear from your explanation that it is necessary), or
> why this behaviour isn't the default behaviour for the plugin.
>
> Regards,
> Graham
> --
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
--
Regards,
Garvin LeClaire
garvin.leclaire@gmail.com
Re: maven-ear-plugin and dependencies
Posted by David Jencks <da...@yahoo.com>.
On Dec 15, 2006, at 3:34 AM, Graham Leggett wrote:
> On Thu, December 14, 2006 9:05 pm, Stephane Nicoll wrote:
>
>> This has been tackled a dozen of times and I am not sure it has
>> anything to do with the EAR plugin, at least if we follow the
>> spec. If
>> I am wrong, please let me know.
>>
>> The valid way to bundle shared components/libs in a EAR is to define
>> the Class-Path entry of the manifest in EJB module(s) using the
>> component. It's certainly not by adding them in a <java> module entry
>> in the application.xml even though some application servers support
>> this (JBoss namely).
>>
>> The EAR plugin supports the APP-INF/lib weblogic's trick by using the
>> defaultJarBundleDir setting though.
>>
>> So I wouldn't say the EAR plugin has no dependency management
>> features
>> at all, I don't even see the point actually :) Make sure that your
>> classpath entries got generated on the EJB side and it will just run
>> fine.
>
> Ok, then I'll put it this way: it has no dependency management
> features
> that are clearly enough documented :)
>
> If you create an ejb using the default ejb configuration, and then
> you add
> this ejb to an ear file again with a default configuration, maven goes
> through all the motions and creates what looks like a valid ear file.
>
> But this ear file refuses to load into Jboss (the dreaded
> NoClassDefFound
> exception).
>
> Is there a reason why a spec compliant ejb and ear can't be created by
> default by the ejb and ear plugins? I'm asking from ignorance - I
> don't
> have in depth knowledge of the internal structure of an ear file, that
> being maven's job to worry about this stuff for me.
The problem is that to build an ear, you have to build an ejb jar
that can only go in that ear, because details of the ear it is going
in have to be put into the ejb jar manifest. Obviously there's no
possible way to guess this from the point of view of the ejb jar
(maybe you plan to run the ejb jar standalone) so you have to specify
it explicitly in the ejb plugin configuration.
As I pointed out earlier, jee5 includes a lib dir in an ear which you
can even name whatever you want. This at least gets ears to the
level of dysfunction of wars.
thanks
david jencks
>
> The only mention I can find about the classpath entry is a FAQ
> entry at
> http://maven.apache.org/plugins/maven-ejb-plugin/faq.html, but this
> rather
> cryptic explanation doesn't indicate why you might want to do this
> (although it seems clear from your explanation that it is
> necessary), or
> why this behaviour isn't the default behaviour for the plugin.
>
> Regards,
> Graham
> --
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: maven-ear-plugin and dependencies
Posted by Graham Leggett <mi...@sharp.fm>.
On Thu, December 14, 2006 9:05 pm, Stephane Nicoll wrote:
> This has been tackled a dozen of times and I am not sure it has
> anything to do with the EAR plugin, at least if we follow the spec. If
> I am wrong, please let me know.
>
> The valid way to bundle shared components/libs in a EAR is to define
> the Class-Path entry of the manifest in EJB module(s) using the
> component. It's certainly not by adding them in a <java> module entry
> in the application.xml even though some application servers support
> this (JBoss namely).
>
> The EAR plugin supports the APP-INF/lib weblogic's trick by using the
> defaultJarBundleDir setting though.
>
> So I wouldn't say the EAR plugin has no dependency management features
> at all, I don't even see the point actually :) Make sure that your
> classpath entries got generated on the EJB side and it will just run
> fine.
Ok, then I'll put it this way: it has no dependency management features
that are clearly enough documented :)
If you create an ejb using the default ejb configuration, and then you add
this ejb to an ear file again with a default configuration, maven goes
through all the motions and creates what looks like a valid ear file.
But this ear file refuses to load into Jboss (the dreaded NoClassDefFound
exception).
Is there a reason why a spec compliant ejb and ear can't be created by
default by the ejb and ear plugins? I'm asking from ignorance - I don't
have in depth knowledge of the internal structure of an ear file, that
being maven's job to worry about this stuff for me.
The only mention I can find about the classpath entry is a FAQ entry at
http://maven.apache.org/plugins/maven-ejb-plugin/faq.html, but this rather
cryptic explanation doesn't indicate why you might want to do this
(although it seems clear from your explanation that it is necessary), or
why this behaviour isn't the default behaviour for the plugin.
Regards,
Graham
--
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: maven-ear-plugin and dependencies
Posted by Stephane Nicoll <st...@gmail.com>.
On 12/14/06, David Jencks <da...@yahoo.com> wrote:
> I agree that spec support is the way to go.
>
> the jee5 ear lets you specify a lib directory (default is "lib")
> where all the jars inside get added to the classpath. We could work
> on jee5 support, that ought to keep everyone happy. Does the
> defaultJarBundleDir do this? I guess if so it might need to be put
> in the generated application.xml?? As you can tell I haven't looked
> at what the plugin actually does now.
Well yes it does just do
[...]
<configuration>
<defaultJarBundleDir>lib</defaultJarBundleDir>
[...]
</configuration>
No we can imagine configuration profiles. If we're using Jave EE5,
this is the default value and libraries (artifact with type = jar) are
automatically copied to this lib directory. Sounds good to me.
There is no solution for 1.3 and 1.4 though but it's a start.
Thanks,
Stéphane
>
> thanks
> david jencks
>
> >
> > Cheers,
> > Stéphane
> >
> > On 12/14/06, Graham Leggett <mi...@sharp.fm> wrote:
> >> Hi all,
> >>
> >> Using the v2.3-SNAPSHOT version of the ear plugin, I am struggling
> >> to get
> >> the application.xml file built correctly.
> >>
> >> Between maven1 and maven2, the ejb plugin lost it's ability to bundle
> >> dependencies inside the ejb.
> >>
> >> This means (as I understand it) that it's now up to the ear plugin
> >> to add
> >> all the dependencies to the application.xml file.
> >>
> >> However, it seems that the maven-ear-plugin does not have any
> >> documented
> >> functionality to add dependencies to application.xml, except for
> >> explicitly declaring dependencies using the jarModule tag.
> >>
> >> This duplicates the dependency list, and removes all the power behind
> >> transitive dependency management, which is supposed to handle
> >> dependencies
> >> for you.
> >>
> >> Is there a setting I am not seeing, or does the ear plugin have no
> >> dependency management features at all?
> >>
> >> Regards,
> >> Graham
> >> --
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: maven-ear-plugin and dependencies
Posted by David Jencks <da...@yahoo.com>.
On Dec 14, 2006, at 11:05 AM, Stephane Nicoll wrote:
> Hi,
>
> This has been tackled a dozen of times and I am not sure it has
> anything to do with the EAR plugin, at least if we follow the spec. If
> I am wrong, please let me know.
>
> The valid way to bundle shared components/libs in a EAR is to define
> the Class-Path entry of the manifest in EJB module(s) using the
> component. It's certainly not by adding them in a <java> module entry
> in the application.xml even though some application servers support
> this (JBoss namely).
>
> The EAR plugin supports the APP-INF/lib weblogic's trick by using the
> defaultJarBundleDir setting though.
>
> So I wouldn't say the EAR plugin has no dependency management features
> at all, I don't even see the point actually :) Make sure that your
> classpath entries got generated on the EJB side and it will just run
> fine.
>
> Now I agree it's not always easy so if you have ideas to improve, let
> us know. I am not sure we can do something at the EAR level, except
> generating EARs that do not follow the spec.
I agree that spec support is the way to go.
the jee5 ear lets you specify a lib directory (default is "lib")
where all the jars inside get added to the classpath. We could work
on jee5 support, that ought to keep everyone happy. Does the
defaultJarBundleDir do this? I guess if so it might need to be put
in the generated application.xml?? As you can tell I haven't looked
at what the plugin actually does now.
thanks
david jencks
>
> Cheers,
> Stéphane
>
> On 12/14/06, Graham Leggett <mi...@sharp.fm> wrote:
>> Hi all,
>>
>> Using the v2.3-SNAPSHOT version of the ear plugin, I am struggling
>> to get
>> the application.xml file built correctly.
>>
>> Between maven1 and maven2, the ejb plugin lost it's ability to bundle
>> dependencies inside the ejb.
>>
>> This means (as I understand it) that it's now up to the ear plugin
>> to add
>> all the dependencies to the application.xml file.
>>
>> However, it seems that the maven-ear-plugin does not have any
>> documented
>> functionality to add dependencies to application.xml, except for
>> explicitly declaring dependencies using the jarModule tag.
>>
>> This duplicates the dependency list, and removes all the power behind
>> transitive dependency management, which is supposed to handle
>> dependencies
>> for you.
>>
>> Is there a setting I am not seeing, or does the ear plugin have no
>> dependency management features at all?
>>
>> Regards,
>> Graham
>> --
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: maven-ear-plugin and dependencies
Posted by Stephane Nicoll <st...@gmail.com>.
Hi,
This has been tackled a dozen of times and I am not sure it has
anything to do with the EAR plugin, at least if we follow the spec. If
I am wrong, please let me know.
The valid way to bundle shared components/libs in a EAR is to define
the Class-Path entry of the manifest in EJB module(s) using the
component. It's certainly not by adding them in a <java> module entry
in the application.xml even though some application servers support
this (JBoss namely).
The EAR plugin supports the APP-INF/lib weblogic's trick by using the
defaultJarBundleDir setting though.
So I wouldn't say the EAR plugin has no dependency management features
at all, I don't even see the point actually :) Make sure that your
classpath entries got generated on the EJB side and it will just run
fine.
Now I agree it's not always easy so if you have ideas to improve, let
us know. I am not sure we can do something at the EAR level, except
generating EARs that do not follow the spec.
Cheers,
Stéphane
On 12/14/06, Graham Leggett <mi...@sharp.fm> wrote:
> Hi all,
>
> Using the v2.3-SNAPSHOT version of the ear plugin, I am struggling to get
> the application.xml file built correctly.
>
> Between maven1 and maven2, the ejb plugin lost it's ability to bundle
> dependencies inside the ejb.
>
> This means (as I understand it) that it's now up to the ear plugin to add
> all the dependencies to the application.xml file.
>
> However, it seems that the maven-ear-plugin does not have any documented
> functionality to add dependencies to application.xml, except for
> explicitly declaring dependencies using the jarModule tag.
>
> This duplicates the dependency list, and removes all the power behind
> transitive dependency management, which is supposed to handle dependencies
> for you.
>
> Is there a setting I am not seeing, or does the ear plugin have no
> dependency management features at all?
>
> Regards,
> Graham
> --
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org