You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Manos Batsis <ma...@geekologue.com> on 2007/02/06 14:57:26 UTC
EAR libs and MANIFEST.MF generation
Hello,
Back in my Ant-based projects i used the pathconvert to generate
manifest files from myruntime.classpathref. I also filtered all those
jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
(thanks to the manifests) both EJBs and WAR classes could access them,
avoiding duplication of library JARs.
I'm getting ready to port the same logic through the antrun plugin, then
use exclusions and what not to finally end up with the same structure
and was wondering if there is a better way to do this.
Thanks in advance,
Manos
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
[solved] Re: EAR libs and MANIFEST.MF generation
Posted by Manos Batsis <ma...@geekologue.com>.
I thought i sent this [1] earlier but it never got through. Still, this
can be improved, the solution forces the EAR POM to include explicitly
all WAR dependencies, which results in duplicate markup between the
POMs.
[1]
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
Thanks for the help all,
Manos
Quoting Stephane Nicoll <st...@gmail.com>:
> Hi,
>
> On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> >
> > Hey Marco,
> >
> > Thanks for your email.
> >
> > Quoting Marco Mistroni <mm...@gmail.com>:
> > > any particular reason for not using maven-ear-plugin, since it
> will
> > > generate manifest classpath entries based on dependencies of your
> > > projects?
> >
>
> Even if you do this, it won't work AFAIK since it's not part of the
> spec. The way to define dependencies between an EJB module and
> third-party libs is to define a manifest for the *EJB* module.
>
> Does this actually work? On which app server?
>
> > * Will the WAR and EJB-JAR obey the EAR manifest? I used to create
> the
> > manifest for those modules with Ant for this structure to work.
>
> I am pretty sure it won't work and this way of working is not
> compliant anyway.
>
> Back to your original question, this is an interesting use case. Why
> don't you generate the manifest when you actually build your EJB
> modules? Maven can do this for your (see the archive settings).
>
> Regards,
> Stéphane
>
> >
> >
> > Many thanks,
> >
> > Manos
> >
> > >
> > > hth
> > > marco
> > >
> > > On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > Back in my Ant-based projects i used the pathconvert to
> generate
> > > > manifest files from myruntime.classpathref. I also filtered all
> > > those
> > > > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib,
> where
> > > > (thanks to the manifests) both EJBs and WAR classes could
> access
> > > them,
> > > > avoiding duplication of library JARs.
> > > >
> > > > I'm getting ready to port the same logic through the antrun
> plugin,
> > > then
> > > > use exclusions and what not to finally end up with the same
> > > structure
> > > > and was wondering if there is a better way to do this.
> > > >
> > > > Thanks in advance,
> > > >
> > > > Manos
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: EAR libs and MANIFEST.MF generation
Posted by Marco Mistroni <mm...@gmail.com>.
Oh dear, thanx Stephane for the clarifications..
I completely forgot that EAR i built were EJB3 based, where i didnt have an
ejb artifact as
i can deploy ejbs as jars
thanks for pointing that out.....
regards
marco
On 2/6/07, Stephane Nicoll <st...@gmail.com> wrote:
>
> Hi,
>
> On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> >
> > Hey Marco,
> >
> > Thanks for your email.
> >
> > Quoting Marco Mistroni <mm...@gmail.com>:
> > > any particular reason for not using maven-ear-plugin, since it will
> > > generate manifest classpath entries based on dependencies of your
> > > projects?
> >
>
> Even if you do this, it won't work AFAIK since it's not part of the
> spec. The way to define dependencies between an EJB module and
> third-party libs is to define a manifest for the *EJB* module.
>
> Does this actually work? On which app server?
>
> > * Will the WAR and EJB-JAR obey the EAR manifest? I used to create the
> > manifest for those modules with Ant for this structure to work.
>
> I am pretty sure it won't work and this way of working is not compliant
> anyway.
>
> Back to your original question, this is an interesting use case. Why
> don't you generate the manifest when you actually build your EJB
> modules? Maven can do this for your (see the archive settings).
>
> Regards,
> Stéphane
>
> >
> >
> > Many thanks,
> >
> > Manos
> >
> > >
> > > hth
> > > marco
> > >
> > > On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > Back in my Ant-based projects i used the pathconvert to generate
> > > > manifest files from myruntime.classpathref. I also filtered all
> > > those
> > > > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
> > > > (thanks to the manifests) both EJBs and WAR classes could access
> > > them,
> > > > avoiding duplication of library JARs.
> > > >
> > > > I'm getting ready to port the same logic through the antrun plugin,
> > > then
> > > > use exclusions and what not to finally end up with the same
> > > structure
> > > > and was wondering if there is a better way to do this.
> > > >
> > > > Thanks in advance,
> > > >
> > > > Manos
> > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: EAR libs and MANIFEST.MF generation
Posted by Stephane Nicoll <st...@gmail.com>.
Hi,
On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
>
> Hey Marco,
>
> Thanks for your email.
>
> Quoting Marco Mistroni <mm...@gmail.com>:
> > any particular reason for not using maven-ear-plugin, since it will
> > generate manifest classpath entries based on dependencies of your
> > projects?
>
Even if you do this, it won't work AFAIK since it's not part of the
spec. The way to define dependencies between an EJB module and
third-party libs is to define a manifest for the *EJB* module.
Does this actually work? On which app server?
> * Will the WAR and EJB-JAR obey the EAR manifest? I used to create the
> manifest for those modules with Ant for this structure to work.
I am pretty sure it won't work and this way of working is not compliant anyway.
Back to your original question, this is an interesting use case. Why
don't you generate the manifest when you actually build your EJB
modules? Maven can do this for your (see the archive settings).
Regards,
Stéphane
>
>
> Many thanks,
>
> Manos
>
> >
> > hth
> > marco
> >
> > On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> > >
> > >
> > >
> > > Hello,
> > >
> > > Back in my Ant-based projects i used the pathconvert to generate
> > > manifest files from myruntime.classpathref. I also filtered all
> > those
> > > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
> > > (thanks to the manifests) both EJBs and WAR classes could access
> > them,
> > > avoiding duplication of library JARs.
> > >
> > > I'm getting ready to port the same logic through the antrun plugin,
> > then
> > > use exclusions and what not to finally end up with the same
> > structure
> > > and was wondering if there is a better way to do this.
> > >
> > > Thanks in advance,
> > >
> > > Manos
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: EAR libs and MANIFEST.MF generation
Posted by Marco Mistroni <mm...@gmail.com>.
Hi Manos
mmm, why would the manifest of the .ear have classpath entries?
the classpath entries you need are in the manifest of your project for which
you have
jars (pls anyone correct me if i m wrong)
what your ear should contain is artifacts for your project,
META-INF\application.xml and common libraries.
I believe maven ear plugin is clever enough to know, if two projects depends
on the same library, to add it to the .EAR (of course, this will depend on
the <scope> of your dependencies)
Pls anyone correct me if i m wrong.. Manos, best suggestion is that you try
a simple .ear project for yourself and see what maven does with Manifest....
i think you'll find solution to your problems quite soon...
if not, let me know, i'll mail you a sample that i have at home so you can
see where all dependencies go
If your war are dependent to libraries which are common to other projects,
don't put them in the war, change their scope so that they won't be
included..
hth
marco
On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
>
>
> Hey Marco,
>
> Thanks for your email.
>
> Quoting Marco Mistroni <mm...@gmail.com>:
> > any particular reason for not using maven-ear-plugin, since it will
> > generate manifest classpath entries based on dependencies of your
> > projects?
>
>
> I use it already, but i probably not to its full extent. The manifest it
> creates for the EAR has no classpath entry. Do i have to tell the plugin
> to create it using jarModule elements for all the runtime dependencies
> or is there an other way?
>
> Even then:
>
> * Do i have to manually exclude the deps from my WAR using the plugin?
> * Will the WAR and EJB-JAR obey the EAR manifest? I used to create the
> manifest for those modules with Ant for this structure to work.
>
>
> Many thanks,
>
> Manos
>
> >
> > hth
> > marco
> >
> > On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> > >
> > >
> > >
> > > Hello,
> > >
> > > Back in my Ant-based projects i used the pathconvert to generate
> > > manifest files from myruntime.classpathref. I also filtered all
> > those
> > > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
> > > (thanks to the manifests) both EJBs and WAR classes could access
> > them,
> > > avoiding duplication of library JARs.
> > >
> > > I'm getting ready to port the same logic through the antrun plugin,
> > then
> > > use exclusions and what not to finally end up with the same
> > structure
> > > and was wondering if there is a better way to do this.
> > >
> > > Thanks in advance,
> > >
> > > Manos
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: EAR libs and MANIFEST.MF generation
Posted by Manos Batsis <ma...@geekologue.com>.
Finaly got it:
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
Cheers,
Manos
Quoting Manos Batsis <ma...@geekologue.com>:
>
> Hey Marco,
>
> Thanks for your email.
>
> Quoting Marco Mistroni <mm...@gmail.com>:
> > any particular reason for not using maven-ear-plugin, since it
> will
> > generate manifest classpath entries based on dependencies of your
> > projects?
>
>
> I use it already, but i probably not to its full extent. The manifest
> it
> creates for the EAR has no classpath entry. Do i have to tell the
> plugin
> to create it using jarModule elements for all the runtime
> dependencies
> or is there an other way?
>
> Even then:
>
> * Do i have to manually exclude the deps from my WAR using the
> plugin?
> * Will the WAR and EJB-JAR obey the EAR manifest? I used to create
> the
> manifest for those modules with Ant for this structure to work.
>
>
> Many thanks,
>
> Manos
>
> >
> > hth
> > marco
> >
> > On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> > >
> > >
> > >
> > > Hello,
> > >
> > > Back in my Ant-based projects i used the pathconvert to generate
> > > manifest files from myruntime.classpathref. I also filtered all
> > those
> > > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib,
> where
> > > (thanks to the manifests) both EJBs and WAR classes could access
> > them,
> > > avoiding duplication of library JARs.
> > >
> > > I'm getting ready to port the same logic through the antrun
> plugin,
> > then
> > > use exclusions and what not to finally end up with the same
> > structure
> > > and was wondering if there is a better way to do this.
> > >
> > > Thanks in advance,
> > >
> > > Manos
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: EAR libs and MANIFEST.MF generation
Posted by Manos Batsis <ma...@geekologue.com>.
Hey Marco,
Thanks for your email.
Quoting Marco Mistroni <mm...@gmail.com>:
> any particular reason for not using maven-ear-plugin, since it will
> generate manifest classpath entries based on dependencies of your
> projects?
I use it already, but i probably not to its full extent. The manifest it
creates for the EAR has no classpath entry. Do i have to tell the plugin
to create it using jarModule elements for all the runtime dependencies
or is there an other way?
Even then:
* Do i have to manually exclude the deps from my WAR using the plugin?
* Will the WAR and EJB-JAR obey the EAR manifest? I used to create the
manifest for those modules with Ant for this structure to work.
Many thanks,
Manos
>
> hth
> marco
>
> On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
> >
> >
> >
> > Hello,
> >
> > Back in my Ant-based projects i used the pathconvert to generate
> > manifest files from myruntime.classpathref. I also filtered all
> those
> > jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
> > (thanks to the manifests) both EJBs and WAR classes could access
> them,
> > avoiding duplication of library JARs.
> >
> > I'm getting ready to port the same logic through the antrun plugin,
> then
> > use exclusions and what not to finally end up with the same
> structure
> > and was wondering if there is a better way to do this.
> >
> > Thanks in advance,
> >
> > Manos
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: EAR libs and MANIFEST.MF generation
Posted by Marco Mistroni <mm...@gmail.com>.
Hi,
any particular reason for not using maven-ear-plugin, since it will
generate manifest classpath entries based on dependencies of your projects?
hth
marco
On 2/6/07, Manos Batsis <ma...@geekologue.com> wrote:
>
>
>
> Hello,
>
> Back in my Ant-based projects i used the pathconvert to generate
> manifest files from myruntime.classpathref. I also filtered all those
> jars out of my WARs/WEB-INF/lib and put them in the EAR/lib, where
> (thanks to the manifests) both EJBs and WAR classes could access them,
> avoiding duplication of library JARs.
>
> I'm getting ready to port the same logic through the antrun plugin, then
> use exclusions and what not to finally end up with the same structure
> and was wondering if there is a better way to do this.
>
> Thanks in advance,
>
> Manos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>