You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mdurrani <ma...@hotmail.com> on 2010/08/30 17:25:27 UTC

copy list of jars into a war

I would like to copy all jars from a lib folder into my war file. I can do it
by listing a dependency tag for each of them but I don't want to put 20
dependency tags in my pom. Is there any way where I can just reference a lib
folder and say to copy all these files to the war?
 
/lib/
    1.jar
    2.jar
    3.jar
    4.jar
    ..
    20.jar


Thanks,

-- 
View this message in context: http://maven.40175.n5.nabble.com/copy-list-of-jars-into-a-war-tp2796933p2796933.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: copy list of jars into a war

Posted by Wayne Fay <wa...@gmail.com>.
> I would like to copy all jars from a lib folder into my war file. I can do it
> by listing a dependency tag for each of them but I don't want to put 20
> dependency tags in my pom. Is there any way where I can just reference a lib
> folder and say to copy all these files to the war?

No. This is simply not how Maven works. Please go back to using Ant if
you require this functionality.

Wayne

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


Re: copy list of jars into a war

Posted by Nayan Hajratwala <na...@chikli.com>.
On Aug 30, 2010, at 11:25 AM, mdurrani wrote:

> I would like to copy all jars from a lib folder into my war file. I can do it...

If you're using maven, then you probably shouldn't have a lib folder full of jar files. If you provide more details about how your build is structured, we can likely help you make it more maven-ish.

---
Nayan Hajratwala
http://agileshrugged.com
http://twitter.com/nhajratw
734.658.6032


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


Re: copy list of jars into a war

Posted by Benson Margulies <bi...@gmail.com>.
Well, far be it from me to contradict an authority, but I can offer an
alternative.

If there is some good reason to treat all those jars as a lump, and if
none of your code that you are compiling depends on having them in the
compilation classpath, you *can* create an artifact for them with the
assembly plugin, and then unpack it into the WAR with the overlay
mechanism.

Your message gives me no reason to believe that this is the right
thing to do in your particular case as opposed to listing out all the
dependencies. You might want to look at dependency inheritance
(scope=pom) as a way of factoring this list of 20 things into one
place.

On Mon, Aug 30, 2010 at 12:09 PM, Stephen Connolly
<st...@gmail.com> wrote:
> On 30 August 2010 17:01, Alexander Vaysberg <wo...@vaisberg.de> wrote:
>
>>  Am 30.08.2010 17:25, schrieb mdurrani:
>>
>>  I would like to copy all jars from a lib folder into my war file. I can do
>>> it
>>> by listing a dependency tag for each of them but I don't want to put 20
>>> dependency tags in my pom. Is there any way where I can just reference a
>>> lib
>>> folder and say to copy all these files to the war?
>>>
>>>
> Use ANT.
>
> The Maven way is to list the dependencies... if you don't want to list
> dependencies, then don't use Maven.
>
> -Stephen
>
> P.S. Sorry if this sounds blunt, but Maven is opinionated software and this
> is a core opinion
>
>
>> /lib/
>>>     1.jar
>>>     2.jar
>>>     3.jar
>>>     4.jar
>>>     ..
>>>     20.jar
>>>
>>>
>>> Thanks,
>>>
>>>  The first you must read more info for Maven(Book for Sonotype).
>> Dependencies must be in the pom.xml.
>>
>>
>> ---------------------------------------------------------------------
>> 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: copy list of jars into a war

Posted by Stephen Connolly <st...@gmail.com>.
On 30 August 2010 17:01, Alexander Vaysberg <wo...@vaisberg.de> wrote:

>  Am 30.08.2010 17:25, schrieb mdurrani:
>
>  I would like to copy all jars from a lib folder into my war file. I can do
>> it
>> by listing a dependency tag for each of them but I don't want to put 20
>> dependency tags in my pom. Is there any way where I can just reference a
>> lib
>> folder and say to copy all these files to the war?
>>
>>
Use ANT.

The Maven way is to list the dependencies... if you don't want to list
dependencies, then don't use Maven.

-Stephen

P.S. Sorry if this sounds blunt, but Maven is opinionated software and this
is a core opinion


> /lib/
>>     1.jar
>>     2.jar
>>     3.jar
>>     4.jar
>>     ..
>>     20.jar
>>
>>
>> Thanks,
>>
>>  The first you must read more info for Maven(Book for Sonotype).
> Dependencies must be in the pom.xml.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: copy list of jars into a war

Posted by Alexander Vaysberg <wo...@vaisberg.de>.
  Am 30.08.2010 17:25, schrieb mdurrani:
> I would like to copy all jars from a lib folder into my war file. I can do it
> by listing a dependency tag for each of them but I don't want to put 20
> dependency tags in my pom. Is there any way where I can just reference a lib
> folder and say to copy all these files to the war?
>
> /lib/
>      1.jar
>      2.jar
>      3.jar
>      4.jar
>      ..
>      20.jar
>
>
> Thanks,
>
The first you must read more info for Maven(Book for Sonotype). 
Dependencies must be in the pom.xml.

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