How to include dependencies in an executable jar?
9 answers - 418 bytes -

I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a way to
do this? The following page was somewhat helpful:
But it doesn't discuss including the JARs. I mean I could add a resources
directory and include the JARs there I believe but I was hopeing for
something more automatic.
Thanks!
-aps
No.1 | | 778 bytes |
| 
Looking through my archive, this topic comes up nearly every week I
guess you didn't search for the answer prior to sending this question?
It was even discussed just yesterday! Look at the thread titled
"Creating a Java application" for some options
Wayne
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a way to
do this? The following page was somewhat helpful:
But it doesn't discuss including the JARs. I mean I could add a resources
directory and include the JARs there I believe but I was hopeing for
something more automatic.
Thanks!
-aps
No.2 | | 1042 bytes |
| 
Ahh you know whatmy email for this list got deleted yesterday (I was
doing some cleaning and I screwed up)!!! My badI will try to search the
archives on the website
-aps
9/22/06, Wayne Fay <waynefay (AT) gmail (DOT) comwrote:
Looking through my archive, this topic comes up nearly every week I
guess you didn't search for the answer prior to sending this question?
It was even discussed just yesterday! Look at the thread titled
"Creating a Java application" for some options
Wayne
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a
way to
do this? The following page was somewhat helpful:
--
But it doesn't discuss including the JARs. I mean I could add a
resources
directory and include the JARs there I believe but I was hopeing for
something more automatic.
Thanks!
-aps
No.3 | | 302 bytes |
| 
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a
way to do this?
try to use the assembly plugin:
No.4 | | 928 bytes |
| 
found the thread (again my bad Wayne)thanks Valerio
However, just like the last thread, this seems like a very awkward way of
handling it (an assembly plugin to just assemble binaries and various
files. I mean one of the anchor item features of maven is its dependency
handling. Be nice to exploit that to just include the dependencies I need
like the WAR and EAR plugins via some scope parameter, no? :D
The P is cool but not acceptable for production (adding an external
jar to run a jaruggh).
-aps
9/22/06, Valerio Schiavoni <valerio.schiavoni (AT) gmail (DOT) comwrote:
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a
way to do this?
--
try to use the assembly plugin:
No.5 | | 1451 bytes |
| 
Alright, I have this owrking minus I can't seem to set the final name of my
zipped assembly.
It seems that the assembly name concat's the <finalNametage with the <id>
tage of my assembly file. I want to call it <something>.zip, how do I do
this? If I leave off final name and just use ID, that doesn't work, if I
use <finalNamebut no ID, then I get name-null.zip.
Thanks!
-aps
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
found the thread (again my bad Wayne)thanks Valerio
However, just like the last thread, this seems like a very awkward way of
handling it (an assembly plugin to just assemble binaries and various
files. I mean one of the anchor item features of maven is its dependency
handling. Be nice to exploit that to just include the dependencies I need
like the WAR and EAR plugins via some scope parameter, no? :D
The P is cool but not acceptable for production (adding an external
jar to run a jaruggh).
-aps
9/22/06, Valerio Schiavoni <valerio.schiavoni (AT) gmail (DOT) comwrote:
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of
the
dependencies of my project in the jar itself for runtime. Is there a
way to do this?
--
try to use the assembly plugin:
No.6 | | 1309 bytes |
| 
Its K I just have to flame every now and then for things like that
in an effort to encourage others to search before sending. Sorry you
were the target in this case. ;-)
I'm not building executable jars personally so I'm afraid I'm not much
help on this topic
Wayne
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
found the thread (again my bad Wayne)thanks Valerio
However, just like the last thread, this seems like a very awkward way of
handling it (an assembly plugin to just assemble binaries and various
files. I mean one of the anchor item features of maven is its dependency
handling. Be nice to exploit that to just include the dependencies I need
like the WAR and EAR plugins via some scope parameter, no? :D
The P is cool but not acceptable for production (adding an external
jar to run a jaruggh).
-aps
9/22/06, Valerio Schiavoni <valerio.schiavoni (AT) gmail (DOT) comwrote:
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a
way to do this?
--
try to use the assembly plugin:
No.7 | | 1643 bytes |
| 
to exclude the id you can use:
<appendAssemblyId>false</appendAssemblyId>
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
Alright, I have this owrking minus I can't seem to set the final name of
my
zipped assembly.
It seems that the assembly name concat's the <finalNametage with the
<id>
tage of my assembly file. I want to call it <something>.zip, how do I do
this? If I leave off final name and just use ID, that doesn't work, if I
use <finalNamebut no ID, then I get name-null.zip.
Thanks!
-aps
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
found the thread (again my bad Wayne)thanks Valerio
However, just like the last thread, this seems like a very awkward way
of
handling it (an assembly plugin to just assemble binaries and various
files. I mean one of the anchor item features of maven is its
dependency
handling. Be nice to exploit that to just include the dependencies I
need
like the WAR and EAR plugins via some scope parameter, no? :D
The P is cool but not acceptable for production (adding an
external
jar to run a jaruggh).
-aps
9/22/06, Valerio Schiavoni <valerio.schiavoni (AT) gmail (DOT) comwrote:
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of
the
dependencies of my project in the jar itself for runtime. Is there
a
way to do this?
--
try to use the assembly plugin:
No.8 | | 1752 bytes |
| 
No flame away. I make it point on all forums (work and play) to search
FIRST ask SECND but in these case I was flying blind (still getting used to
Gmail's labeling feature). Anyway, the assembly plugin isn't that bad
(feels like ANT).
Now I just need this name thing sorted out? (finalName should be FINAL
NAME!!!)
-aps
9/22/06, Wayne Fay <waynefay (AT) gmail (DOT) comwrote:
Its K I just have to flame every now and then for things like that
in an effort to encourage others to search before sending. Sorry you
were the target in this case. ;-)
I'm not building executable jars personally so I'm afraid I'm not much
help on this topic
Wayne
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
found the thread (again my bad Wayne)thanks Valerio
However, just like the last thread, this seems like a very awkward way
of
handling it (an assembly plugin to just assemble binaries and various
files. I mean one of the anchor item features of maven is its
dependency
handling. Be nice to exploit that to just include the dependencies I
need
like the WAR and EAR plugins via some scope parameter, no? :D
The P is cool but not acceptable for production (adding an
external
jar to run a jaruggh).
-aps
9/22/06, Valerio Schiavoni <valerio.schiavoni (AT) gmail (DOT) comwrote:
Hello Alexander,
9/22/06, Alexander Sack <pisymbol (AT) gmail (DOT) comwrote:
I'm trying to build an executable jar and I want to include some of
the
dependencies of my project in the jar itself for runtime. Is there
a
way to do this?
--
try to use the assembly plugin:
No.9 | | 452 bytes |
| 
Alexander Sack-3 wrote:
I'm trying to build an executable jar and I want to include some of the
dependencies of my project in the jar itself for runtime. Is there a way
to
do this? The following page was somewhat helpful:
But it doesn't discuss including the JARs. I mean I could add a resources
directory and include the JARs there I believe but I was hopeing for
something more automatic.
Thanks!
-aps