You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by pranay agarwal <st...@gmail.com> on 2012/04/27 20:29:13 UTC

excluding a file inside a jar while building a war file

 hi, i am trying to build a war file . Now  is there a way by which
one can exclude certain files from a jar which is included inside this
war ?
e.g  for building a war file say sample.war , i include myjar.jar as a
dependency but want to exclude myjar.jar/somefolder/somefile in it
inside this war, so is this possible?
Thanks

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


Re: excluding a file inside a jar while building a war file

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

> hi, actually the jar has structure as: 
> resources/folder1/file1.xml 
> resources/folder2/file2.xml
> resources/folder2/file3.xml
> 
> Now i include this jar as a dependency for 3 different wars and for each
> war in need to include only either file1.xml OR file2.xml OR file3.xml
> 
> Could you please tell how to use the upack/assembly here?
> Thanks.
The best solution take a look here:

http://stackoverflow.com/questions/10372197/excluding-certain-files-from-a-jar-which-is-a-dependency-in-a-war-in-maven3

Kind regards
Karl-Heinz Marbaise
-- 
MfG
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                     USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de


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


Re: excluding a file inside a jar while building a war file

Posted by pranay agarwal <st...@gmail.com>.
hi, actually the jar has structure as: 
resources/folder1/file1.xml 
resources/folder2/file2.xml
resources/folder2/file3.xml

Now i include this jar as a dependency for 3 different wars and for each war
in need to include only either file1.xml OR file2.xml OR file3.xml

Could you please tell how to use the upack/assembly here?
Thanks.

--
View this message in context: http://maven.40175.n5.nabble.com/excluding-a-file-inside-a-jar-while-building-a-war-file-tp5671137p5685051.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: excluding a file inside a jar while building a war file

Posted by Wayne Fay <wa...@gmail.com>.
>  hi, i am trying to build a war file . Now  is there a way by which
> one can exclude certain files from a jar which is included inside this
> war ?

Yes but it is a hassle (with dependency:unpack and assembly etc).

> e.g  for building a war file say sample.war , i include myjar.jar as a
> dependency but want to exclude myjar.jar/somefolder/somefile in it
> inside this war, so is this possible?

As Hilco already stated, you should include that file in its own
artifact, then depend (or not) on it directly where it is needed,
instead of getting yourself into this difficult position with having
to pull it out when building some other artifacts that should not
include it.

Wayne

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


Re: excluding a file inside a jar while building a war file

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 27 April 2012 11:29, pranay agarwal <st...@gmail.com> wrote:
>  hi, i am trying to build a war file . Now  is there a way by which
> one can exclude certain files from a jar which is included inside this
> war ?

Don't put them in the JAR in the first place?

> e.g  for building a war file say sample.war , i include myjar.jar as a
> dependency but want to exclude myjar.jar/somefolder/somefile in it
> inside this war, so is this possible?

If the need for "somefile" depends on other things then put it in a
different JAR/artifact and depend on that artifact where you actually
need it.

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