You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by JavierL <xl...@gmail.com> on 2007/04/25 11:53:01 UTC

jar with dependencies in a folder


Hi

My application is a jar file and when I run mvn package it generates my jar
ok.

But I need to distribute my app with all the related jar dependencies so I
wonder how could I do it with maven2..

Actually, I did an ant task that at package cycle copy my project
depdenciens from mvnrepository to a lib folder inside target folder. It
works well but force me to make the list of files to be copied by hand. I
want to see maven doing this job automatically...

Is this posible ?

Thanks in advance
J



-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10177639
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Chull <dr...@yahoo.co.in>.
What is the final solution then?
How did it work?






Gregory Kick-2 wrote:
> 
> When I read this thread it bothered me that people were recommending
> the dependency plugin because it seemed like something that the
> assembly plugin should be able to do on its own.  I think that the
> following ought to get you what you wanted without that plugin.
> 
> <assembly xmlns="http://maven.apache.org/POM/4.0.0"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/assembly-1.0.0.xsd">
>   <id>mydist</id>
>   <formats>
>     <format>zip</format>
>   </formats>
>   <fileSets>
>     <fileSet>
>       <directory>target</directory>
>       <outputDirectory></outputDirectory>
>       <includes>
>         <include>*.jar</include>
>       </includes>
>     </fileSet>
>   </fileSets>
>   <dependencySets>
>     <dependencySet>
>       <outputDirectory>lib</outputDirectory>
>       <unpack>false</unpack>
>       <scope>runtime</scope>
>     </dependencySet>
>   </dependencySets>
> </assembly>
> 
> On 4/26/07, JavierL <xl...@gmail.com> wrote:
>>
>> Finally, it worked...thanks a lot !
>>
>>
>>
>> Wayne Fay wrote:
>> >
>> > I could be wrong about that. Check the other examples. You might
>> > actually want copy-dependencies.
>> >
>> > Wayne
>> >
>> > On 4/25/07, Wayne Fay <wa...@gmail.com> wrote:
>> >> You probably want "dependency:unpack-dependencies".
>> >>
>> >> Wayne
>> >>
>> >> On 4/25/07, JavierL <xl...@gmail.com> wrote:
>> >> >
>> >> >
>> >> > Wayne Fay wrote:
>> >> > >
>> >> > > Ah! In that case, you want to use the maven-dependency-plugin:
>> >> > > http://maven.apache.org/plugins/maven-dependency-plugin/
>> >> > >
>> >> >
>> >> >
>> >> > I've read docs and see this:
>> >> >
>> >> > ----------
>> >> > <artifactItems>
>> >> >            <artifactItem>
>> >> >              <groupId>[ groupId ]</groupId>
>> >> >              <artifactId>[ artifactId ]</artifactId>
>> >> >              <version>[ version ]</version>
>> >> >              <type>[ packaging ]</type>
>> >> >              <overWrite>[ true or false ]</overWrite>
>> >> >              <outputDirectory>[ output directory ]</outputDirectory>
>> >> >              <destFileName>[ filename ]</destFileName>
>> >> >            </artifactItem>
>> >> > -----------
>> >> >
>> >> > I wonder if it means  every dependency to be copied should be write
>> by
>> >> hand
>> >> > in such way.
>> >> >
>> >> > I hope to be wrong because I found this totally ilogical. I want
>> >> something
>> >> > to do the job automatically and not complicate the verbose maven pom
>> >> > configuration.
>> >> >
>> >> > Thanks in advance
>> >> >
>> >> > J
>> >> >
>> >> >
>> >> > J
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
>> >> > Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > 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
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10195552
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> -- 
> Gregory Kick
> http://kickstyle.net/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tp10177639p25029204.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Gregory Kick <gk...@gmail.com>.
When I read this thread it bothered me that people were recommending
the dependency plugin because it seemed like something that the
assembly plugin should be able to do on its own.  I think that the
following ought to get you what you wanted without that plugin.

<assembly xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/assembly-1.0.0.xsd">
  <id>mydist</id>
  <formats>
    <format>zip</format>
  </formats>
  <fileSets>
    <fileSet>
      <directory>target</directory>
      <outputDirectory></outputDirectory>
      <includes>
        <include>*.jar</include>
      </includes>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputDirectory>lib</outputDirectory>
      <unpack>false</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
</assembly>

On 4/26/07, JavierL <xl...@gmail.com> wrote:
>
> Finally, it worked...thanks a lot !
>
>
>
> Wayne Fay wrote:
> >
> > I could be wrong about that. Check the other examples. You might
> > actually want copy-dependencies.
> >
> > Wayne
> >
> > On 4/25/07, Wayne Fay <wa...@gmail.com> wrote:
> >> You probably want "dependency:unpack-dependencies".
> >>
> >> Wayne
> >>
> >> On 4/25/07, JavierL <xl...@gmail.com> wrote:
> >> >
> >> >
> >> > Wayne Fay wrote:
> >> > >
> >> > > Ah! In that case, you want to use the maven-dependency-plugin:
> >> > > http://maven.apache.org/plugins/maven-dependency-plugin/
> >> > >
> >> >
> >> >
> >> > I've read docs and see this:
> >> >
> >> > ----------
> >> > <artifactItems>
> >> >            <artifactItem>
> >> >              <groupId>[ groupId ]</groupId>
> >> >              <artifactId>[ artifactId ]</artifactId>
> >> >              <version>[ version ]</version>
> >> >              <type>[ packaging ]</type>
> >> >              <overWrite>[ true or false ]</overWrite>
> >> >              <outputDirectory>[ output directory ]</outputDirectory>
> >> >              <destFileName>[ filename ]</destFileName>
> >> >            </artifactItem>
> >> > -----------
> >> >
> >> > I wonder if it means  every dependency to be copied should be write by
> >> hand
> >> > in such way.
> >> >
> >> > I hope to be wrong because I found this totally ilogical. I want
> >> something
> >> > to do the job automatically and not complicate the verbose maven pom
> >> > configuration.
> >> >
> >> > Thanks in advance
> >> >
> >> > J
> >> >
> >> >
> >> > J
> >> >
> >> > --
> >> > View this message in context:
> >> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
> >> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10195552
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Gregory Kick
http://kickstyle.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by JavierL <xl...@gmail.com>.
Finally, it worked...thanks a lot !



Wayne Fay wrote:
> 
> I could be wrong about that. Check the other examples. You might
> actually want copy-dependencies.
> 
> Wayne
> 
> On 4/25/07, Wayne Fay <wa...@gmail.com> wrote:
>> You probably want "dependency:unpack-dependencies".
>>
>> Wayne
>>
>> On 4/25/07, JavierL <xl...@gmail.com> wrote:
>> >
>> >
>> > Wayne Fay wrote:
>> > >
>> > > Ah! In that case, you want to use the maven-dependency-plugin:
>> > > http://maven.apache.org/plugins/maven-dependency-plugin/
>> > >
>> >
>> >
>> > I've read docs and see this:
>> >
>> > ----------
>> > <artifactItems>
>> >            <artifactItem>
>> >              <groupId>[ groupId ]</groupId>
>> >              <artifactId>[ artifactId ]</artifactId>
>> >              <version>[ version ]</version>
>> >              <type>[ packaging ]</type>
>> >              <overWrite>[ true or false ]</overWrite>
>> >              <outputDirectory>[ output directory ]</outputDirectory>
>> >              <destFileName>[ filename ]</destFileName>
>> >            </artifactItem>
>> > -----------
>> >
>> > I wonder if it means  every dependency to be copied should be write by
>> hand
>> > in such way.
>> >
>> > I hope to be wrong because I found this totally ilogical. I want
>> something
>> > to do the job automatically and not complicate the verbose maven pom
>> > configuration.
>> >
>> > Thanks in advance
>> >
>> > J
>> >
>> >
>> > J
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
>> > Sent from the Maven - Users mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10195552
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Wayne Fay <wa...@gmail.com>.
I could be wrong about that. Check the other examples. You might
actually want copy-dependencies.

Wayne

On 4/25/07, Wayne Fay <wa...@gmail.com> wrote:
> You probably want "dependency:unpack-dependencies".
>
> Wayne
>
> On 4/25/07, JavierL <xl...@gmail.com> wrote:
> >
> >
> > Wayne Fay wrote:
> > >
> > > Ah! In that case, you want to use the maven-dependency-plugin:
> > > http://maven.apache.org/plugins/maven-dependency-plugin/
> > >
> >
> >
> > I've read docs and see this:
> >
> > ----------
> > <artifactItems>
> >            <artifactItem>
> >              <groupId>[ groupId ]</groupId>
> >              <artifactId>[ artifactId ]</artifactId>
> >              <version>[ version ]</version>
> >              <type>[ packaging ]</type>
> >              <overWrite>[ true or false ]</overWrite>
> >              <outputDirectory>[ output directory ]</outputDirectory>
> >              <destFileName>[ filename ]</destFileName>
> >            </artifactItem>
> > -----------
> >
> > I wonder if it means  every dependency to be copied should be write by hand
> > in such way.
> >
> > I hope to be wrong because I found this totally ilogical. I want something
> > to do the job automatically and not complicate the verbose maven pom
> > configuration.
> >
> > Thanks in advance
> >
> > J
> >
> >
> > J
> >
> > --
> > View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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: jar with dependencies in a folder

Posted by Wayne Fay <wa...@gmail.com>.
You probably want "dependency:unpack-dependencies".

Wayne

On 4/25/07, JavierL <xl...@gmail.com> wrote:
>
>
> Wayne Fay wrote:
> >
> > Ah! In that case, you want to use the maven-dependency-plugin:
> > http://maven.apache.org/plugins/maven-dependency-plugin/
> >
>
>
> I've read docs and see this:
>
> ----------
> <artifactItems>
>            <artifactItem>
>              <groupId>[ groupId ]</groupId>
>              <artifactId>[ artifactId ]</artifactId>
>              <version>[ version ]</version>
>              <type>[ packaging ]</type>
>              <overWrite>[ true or false ]</overWrite>
>              <outputDirectory>[ output directory ]</outputDirectory>
>              <destFileName>[ filename ]</destFileName>
>            </artifactItem>
> -----------
>
> I wonder if it means  every dependency to be copied should be write by hand
> in such way.
>
> I hope to be wrong because I found this totally ilogical. I want something
> to do the job automatically and not complicate the verbose maven pom
> configuration.
>
> Thanks in advance
>
> J
>
>
> J
>
> --
> View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: jar with dependencies in a folder

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You have copy/unpack that lets you specify certain artifacts to
manipulate that may not necessarilly be part of your dependencies (think
zip files).

You also have copy-dependencies/unpack-dependencies that starts with the
list of all dependencies and provides ways to filter that list down by
transitivity/scope/group/artifactId/classifier etc.
 

-----Original Message-----
From: JavierL [mailto:xleyba@gmail.com] 
Sent: Wednesday, April 25, 2007 4:00 PM
To: users@maven.apache.org
Subject: Re: jar with dependencies in a folder



Wayne Fay wrote:
> 
> Ah! In that case, you want to use the maven-dependency-plugin:
> http://maven.apache.org/plugins/maven-dependency-plugin/
> 


I've read docs and see this:

----------
<artifactItems>
            <artifactItem>
              <groupId>[ groupId ]</groupId>
              <artifactId>[ artifactId ]</artifactId>
              <version>[ version ]</version>
              <type>[ packaging ]</type>
              <overWrite>[ true or false ]</overWrite>
              <outputDirectory>[ output directory ]</outputDirectory>
              <destFileName>[ filename ]</destFileName>
            </artifactItem>
-----------

I wonder if it means  every dependency to be copied should be write by
hand in such way. 

I hope to be wrong because I found this totally ilogical. I want
something to do the job automatically and not complicate the verbose
maven pom configuration.

Thanks in advance

J


J

--
View this message in context:
http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.ht
ml#a10188383
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: jar with dependencies in a folder

Posted by JavierL <xl...@gmail.com>.

Wayne Fay wrote:
> 
> Ah! In that case, you want to use the maven-dependency-plugin:
> http://maven.apache.org/plugins/maven-dependency-plugin/
> 


I've read docs and see this:

----------
<artifactItems>
            <artifactItem>
              <groupId>[ groupId ]</groupId>
              <artifactId>[ artifactId ]</artifactId>
              <version>[ version ]</version>
              <type>[ packaging ]</type>
              <overWrite>[ true or false ]</overWrite>
              <outputDirectory>[ output directory ]</outputDirectory>
              <destFileName>[ filename ]</destFileName>
            </artifactItem>
-----------

I wonder if it means  every dependency to be copied should be write by hand
in such way. 

I hope to be wrong because I found this totally ilogical. I want something
to do the job automatically and not complicate the verbose maven pom
configuration.

Thanks in advance

J


J

-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10188383
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Wayne Fay <wa...@gmail.com>.
Ah! In that case, you want to use the maven-dependency-plugin:
http://maven.apache.org/plugins/maven-dependency-plugin/

Wayne

On 4/25/07, JavierL <xl...@gmail.com> wrote:
>
>
> Wayne Fay wrote:
> >
> > Its not clear what you want...
> >
> > First you say you want your jar plus all dependencies. Jo gave that to
> > you and you were happy.
> >
> > Now you come back and you've changed your mind.
> >
> > What exactly are you looking for?
> >
>
> Ouch, sorry, my english is not as good as I would like.
>
> To be clear I never said I want dependencies  _inside_ my jar. I said I want
> to distribute my jar app with all dependencies inside a lib folder.
>
> The first time I distribute my app I'll need to distribute this big zip
> file. But then, if I need to distribute a change in my app I'll need to
> distribute just my little jar application without the dependencies.
>
> To be more clear, this is what I get with my ant task in target folder:
>
> -----------------------------
> aplicacionb-2.0.jar
> aplicacionb.properties
> log4j.xml
> ¦
> +---lib
>        ant-1.6.2.jar
>        antlr-2.7.6.jar
>        aopalliance-1.0.jar
>        asm-1.5.3.jar
>        asm-attrs-1.5.3.jar
>        avalon-framework-4.1.3.jar
>        backport-util-concurrent-2.0_01_pd.jar
>        cglib-2.1_3.jar
>        commons-beanutils-1.7.0.jar
>        commons-collections-3.1.jar
>        commons-dbcp-1.2.1.jar
>        commons-discovery-0.4.jar
>        commons-lang-2.1.jar
>        commons-logging-1.1.jar
>        commons-pool-1.2.jar
>        dbunit-2.2.jar
>        dom4j-1.6.1.jar
>        ehcache-1.2.3.jar
>        hibernate-3.2.2.ga.jar
>        ........etc, etc, etc
> ------------------
>
> and then I compress everything by hand with winzip to get aplicacionb.zip.
>
> I want to get this with maven2.
>
> Is it possible ?
>
> Thanks in advance
>
> J
>
>
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10185870
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: jar with dependencies in a folder

Posted by JavierL <xl...@gmail.com>.

Wayne Fay wrote:
> 
> Its not clear what you want...
> 
> First you say you want your jar plus all dependencies. Jo gave that to
> you and you were happy.
> 
> Now you come back and you've changed your mind.
> 
> What exactly are you looking for?
> 

Ouch, sorry, my english is not as good as I would like.

To be clear I never said I want dependencies  _inside_ my jar. I said I want
to distribute my jar app with all dependencies inside a lib folder.

The first time I distribute my app I'll need to distribute this big zip
file. But then, if I need to distribute a change in my app I'll need to
distribute just my little jar application without the dependencies.

To be more clear, this is what I get with my ant task in target folder:

-----------------------------
aplicacionb-2.0.jar
aplicacionb.properties
log4j.xml
¦
+---lib
        ant-1.6.2.jar
        antlr-2.7.6.jar
        aopalliance-1.0.jar
        asm-1.5.3.jar
        asm-attrs-1.5.3.jar
        avalon-framework-4.1.3.jar
        backport-util-concurrent-2.0_01_pd.jar
        cglib-2.1_3.jar
        commons-beanutils-1.7.0.jar
        commons-collections-3.1.jar
        commons-dbcp-1.2.1.jar
        commons-discovery-0.4.jar
        commons-lang-2.1.jar
        commons-logging-1.1.jar
        commons-pool-1.2.jar
        dbunit-2.2.jar
        dom4j-1.6.1.jar
        ehcache-1.2.3.jar
        hibernate-3.2.2.ga.jar
	........etc, etc, etc 
------------------

and then I compress everything by hand with winzip to get aplicacionb.zip. 

I want to get this with maven2.

Is it possible ?

Thanks in advance

J







-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10185870
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Wayne Fay <wa...@gmail.com>.
Its not clear what you want...

First you say you want your jar plus all dependencies. Jo gave that to
you and you were happy.

Now you come back and you've changed your mind.

What exactly are you looking for?

Wayne

On 4/25/07, JavierL <xl...@gmail.com> wrote:
>
>
> Hi
>
> I'm trying with this plugin to get what I waht but without success...
>
> I see jar-with-dependencies but I don't want this. With this assembly my 82k
> application jar will weight around 6MB (because will include Spring,
> Hibernate and so on). If each time I need to make a fix in my app, I'll need
> to distribute 6MB...
>
>
> I need to get a zip to make a initial distribution of my app. It shoud
> include my app.jar file and lib folder with all my jar dependencies.
>
> After read docs I did:
>
> -----
> <assembly>
>        <id>mydist</id>
>        <formats>
>        <format>zip</format>
>        </formats>
>        <includeBaseDirectory>false</includeBaseDirectory>
>        <dependencySets>
>        <dependencySet>
>                <outputDirectory></outputDirectory>
>                <outputFileNameMapping></outputFileNameMapping>
>                <unpack>false</unpack>
>                <scope>compile</scope>
>        </dependencySet>
>        </dependencySets>
>        <files>
>                <file>
>                <source>target/aplicacionb-2.0.jar</source>
>                <outputDirectory></outputDirectory>
>            </file>
>        </files>
> </assembly>
> ---------
>
> And it generates a zip file with my app.jar but no notices about
> dependencies jar !
>
> Could somebody please give me a clue ?
>
> Thanks in advance
>
> J
>
> --
> View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10178691
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: jar with dependencies in a folder

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

The dependencies are missing because you specified a scope of 'compile',
while the default scope for dependencies is 'runtime'. Just remove the
scope restriction from the assembly descriptor and the dependencies
should be included.

-Tim

Am Mittwoch, den 25.04.2007, 04:10 -0700 schrieb JavierL:
> 
> Hi
> 
> I'm trying with this plugin to get what I waht but without success...
> 
> I see jar-with-dependencies but I don't want this. With this assembly my 82k
> application jar will weight around 6MB (because will include Spring,
> Hibernate and so on). If each time I need to make a fix in my app, I'll need
> to distribute 6MB...
> 
> 
> I need to get a zip to make a initial distribution of my app. It shoud
> include my app.jar file and lib folder with all my jar dependencies.
> 
> After read docs I did:
> 
> -----
> <assembly>
>   	<id>mydist</id>
>   	<formats>
>     	<format>zip</format>
>   	</formats>
>   	<includeBaseDirectory>false</includeBaseDirectory>
>   	<dependencySets>
>     	<dependencySet>
>       		<outputDirectory></outputDirectory>
>       		<outputFileNameMapping></outputFileNameMapping>
>       		<unpack>false</unpack>
>       		<scope>compile</scope>
>     	</dependencySet>
>   	</dependencySets>
>   	<files>
> 		<file>
> 	      	<source>target/aplicacionb-2.0.jar</source>
> 	      	<outputDirectory></outputDirectory>	      	
> 	    </file>
>   	</files>
> </assembly>
> ---------
> 
> And it generates a zip file with my app.jar but no notices about
> dependencies jar !
> 
> Could somebody please give me a clue ?
> 
> Thanks in advance
> 
> J
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by JavierL <xl...@gmail.com>.

Hi

I'm trying with this plugin to get what I waht but without success...

I see jar-with-dependencies but I don't want this. With this assembly my 82k
application jar will weight around 6MB (because will include Spring,
Hibernate and so on). If each time I need to make a fix in my app, I'll need
to distribute 6MB...


I need to get a zip to make a initial distribution of my app. It shoud
include my app.jar file and lib folder with all my jar dependencies.

After read docs I did:

-----
<assembly>
  	<id>mydist</id>
  	<formats>
    	<format>zip</format>
  	</formats>
  	<includeBaseDirectory>false</includeBaseDirectory>
  	<dependencySets>
    	<dependencySet>
      		<outputDirectory></outputDirectory>
      		<outputFileNameMapping></outputFileNameMapping>
      		<unpack>false</unpack>
      		<scope>compile</scope>
    	</dependencySet>
  	</dependencySets>
  	<files>
		<file>
	      	<source>target/aplicacionb-2.0.jar</source>
	      	<outputDirectory></outputDirectory>	      	
	    </file>
  	</files>
</assembly>
---------

And it generates a zip file with my app.jar but no notices about
dependencies jar !

Could somebody please give me a clue ?

Thanks in advance

J

-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10178691
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by JavierL <xl...@gmail.com>.

Thanks and hope you have a good trip !!!

J


Jo Vandermeeren wrote:
> 
> Javier,
> 
> The maven-assembly-plugin can do that for you..
> http://maven.apache.org/plugins/maven-assembly-plugin/
> 
> Here's a snippet to add to your build plugins:
> 
>             <plugin>
>                 <artifactId>maven-assembly-plugin</artifactId>
>                 <configuration>
>                     <descriptorRefs>
>                        
> <descriptorRef>jar-with-dependencies</descriptorRef>
> 
>                     </descriptorRefs>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <id>make-assembly</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>attached</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
> 
> Cheers.. and now I'm off to catch my flight to thailand! :)
> Jo
> 
> On 4/25/07, JavierL <xl...@gmail.com> wrote:
>>
>>
>>
>> Hi
>>
>> My application is a jar file and when I run mvn package it generates my
>> jar
>> ok.
>>
>> But I need to distribute my app with all the related jar dependencies so
>> I
>> wonder how could I do it with maven2..
>>
>> Actually, I did an ant task that at package cycle copy my project
>> depdenciens from mvnrepository to a lib folder inside target folder. It
>> works well but force me to make the list of files to be copied by hand. I
>> want to see maven doing this job automatically...
>>
>> Is this posible ?
>>
>> Thanks in advance
>> J
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10177639
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10177928
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jar with dependencies in a folder

Posted by Jo Vandermeeren <jo...@gmail.com>.
Javier,

The maven-assembly-plugin can do that for you..
http://maven.apache.org/plugins/maven-assembly-plugin/

Here's a snippet to add to your build plugins:

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>

                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Cheers.. and now I'm off to catch my flight to thailand! :)
Jo

On 4/25/07, JavierL <xl...@gmail.com> wrote:
>
>
>
> Hi
>
> My application is a jar file and when I run mvn package it generates my
> jar
> ok.
>
> But I need to distribute my app with all the related jar dependencies so I
> wonder how could I do it with maven2..
>
> Actually, I did an ant task that at package cycle copy my project
> depdenciens from mvnrepository to a lib folder inside target folder. It
> works well but force me to make the list of files to be copied by hand. I
> want to see maven doing this job automatically...
>
> Is this posible ?
>
> Thanks in advance
> J
>
>
>
> --
> View this message in context:
> http://www.nabble.com/jar-with-dependencies-in-a-folder-tf3644333s177.html#a10177639
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>