what I think you are asking to do is:
1. add the jars you want to embed (you do know that the jar spec does
not support opening jars within jars as if they are jars... you can
process them youself, but they cannot be added to the classpath) as
dependencies to the pom with some scope that is not transitive
(provided is probably best)
2. use the maven dependency plugin's copy-dependencies goal to copy
the artifacts (you will need to use the
includeScope/includeArtifactIds/includeGroupIds to carefully pull out
just the ones you want) and have it output them in
${project.build.directory}/generated-resources/dependency
3. use the buildhelper-maven-plugin @mojo's add-resource goal to add
${project.build.directory}/generated-resources/dependency as a
resource directory

and presto-chango you will have the jars you selected embedded within your jar.

-Stephen

P.S.
I suspect you will find that you have hit the perils of getting what
you asked is not always what you want

On 7 April 2011 14:17, Sathyanarayana, Divya
<[email protected]> wrote:
> Yes but I do not want to do that manually. Is there a way to tell pom to
> include it in src/main/resources?
>
> Regards,
> Divya Arun
>
> This e-mail, including any attachment(s) hereto, is intended only for
> the individual or entity to whom it is addressed. It may contain
> proprietary, confidential or privileged information or attorney work
> product belonging to Fidelity Business Services India Pvt. Ltd. (FBS
> India) or its affiliates. If you are not the intended recipient of this
> e-mail, or if you have otherwise received this e-mail in error, please
> immediately notify the sender via return e-mail and permanently delete
> the original mail, any print outs and any copies, including any
> attachments. Any dissemination, distribution, alteration or copying of
> this e-mail is strictly prohibited. The originator of this e-mail does
> not guarantee the security of this message and will not be responsible
> for any damages arising from any dissemination, distribution, alteration
> or copying of this message and/or any attachments to this message by a
> third party or as a result of any virus being passed on. Any comments or
> statements made in this are not necessarily those of FBS India or any
> other Fidelity entity. All e-mails sent from or to FBS India may be
> subject to our monitoring and recording procedures.
>
>
>
>
>  _____
>
>        From: Rafael Vanderlei [mailto:[email protected]]
>        Sent: Thursday, April 07, 2011 6:25 PM
>        To: Maven Users List
>        Cc: Sathyanarayana, Divya
>        Subject: Re: Include dependency jars in the resources
>
>
>        If I got what you meant, you could put the jars in the directory
> src/main/resources (which is Maven's standard directory for resources)
> and then Maven would include it in the root of the final generated jar.
>
>        Regards,
>        Rafael.
>
>
>        On Thu, Apr 7, 2011 at 9:14 AM, Sathyanarayana, Divya
> <[email protected]> wrote:
>
>
>                Hi,
>                I am new to Maven so, please help me out with the
> solution.
>                I have set up a Java project and the pom creates a jar
> out of it. It has
>                5 dependency jars which are in my repository and the
> project refers to
>                it fine (M2_REPO)
>                These external jars are being placed under src directory
> but are not
>                packaged with jar.
>                I want to include these external jars in my jar. (Do not
> want to place
>                each jar in resource manually)
>
>                How do you tell pom.xml to include dependency jars in
> resources of the
>                jar?
>
>
>                Regards,
>                Divya Arun
>                Fidelity India
>
>                This e-mail, including any attachment(s) hereto, is
> intended only for
>                the individual or entity to whom it is addressed. It may
> contain
>                proprietary, confidential or privileged information or
> attorney work
>                product belonging to Fidelity Business Services India
> Pvt. Ltd. (FBS
>                India) or its affiliates. If you are not the intended
> recipient of this
>                e-mail, or if you have otherwise received this e-mail in
> error, please
>                immediately notify the sender via return e-mail and
> permanently delete
>                the original mail, any print outs and any copies,
> including any
>                attachments. Any dissemination, distribution, alteration
> or copying of
>                this e-mail is strictly prohibited. The originator of
> this e-mail does
>                not guarantee the security of this message and will not
> be responsible
>                for any damages arising from any dissemination,
> distribution, alteration
>                or copying of this message and/or any attachments to
> this message by a
>                third party or as a result of any virus being passed on.
> Any comments or
>                statements made in this are not necessarily those of FBS
> India or any
>                other Fidelity entity. All e-mails sent from or to FBS
> India may be
>                subject to our monitoring and recording procedures.
>
>
>
> ---------------------------------------------------------------------
>                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