You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by turbo-555 <fd...@ticino.com> on 2009/06/16 11:11:30 UTC

Excluding files/webapp folder from a war

Hi all,

I tried using the search, but I haven't found anything that could help me.

I'm building a war package:
<packaging>war</packaging>..

but I need to keep out of the war the static part of the project, that would
be the whole webapp folder...
the structure of my project:
src:
  -main:
    -java
    -resources
    -webapp:
      -help
      -images
      -static
      -style
      -WEB-INF


If I run mvn package I get a war with in it:
-help
-images
-static
-style
-...


is there a possibility to have mvn exclude these files?
I tried using the war plugin, but I must have missed something...


thanks

-- 
View this message in context: http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24050485.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 files/webapp folder from a war

Posted by turbo-555 <fd...@ticino.com>.


Damon Silver wrote:
> 
> I managed to get it working (maven 2.0.9, maven-war-plugin 2.1-beta-1)
> with
> the following:
> 
> <configuration>
> ...
> <packagingExcludes>**/*.bat,.classpath,**/*.java,pom.xml,.project,.settings/
> **,**/*.sh,target/**</packagingExcludes>
> ...
> </configuration>
> 
> Hope that helps.
> 
> - Damon
> 


this works, thanks!
I'll just have to make sure there aren't any folders that match the
exclusion parameters that need to be in the package...
-- 
View this message in context: http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24070522.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 files/webapp folder from a war

Posted by Damon Silver <da...@diio.net>.
I managed to get it working (maven 2.0.9, maven-war-plugin 2.1-beta-1) with
the following:

<configuration>
...
<packagingExcludes>**/*.bat,.classpath,**/*.java,pom.xml,.project,.settings/
**,**/*.sh,target/**</packagingExcludes>
...
</configuration>

Hope that helps.

- Damon

-----Original Message-----
From: turbo-555 [mailto:fdurbin@ticino.com] 
Sent: Tuesday, June 16, 2009 5:52 AM
To: users@maven.apache.org
Subject: Re: Excluding files/webapp folder from a war




rynam0 wrote:
> 
> Try something like this?
> 
>         <configuration>
> 
>
<warSourceExcludes>src/main/webapp/someExcludedDirectory/**</warSourceExclud
es>
>         </configuration>
> 

I removed the "<packaging>war</packaging> at the beginning of the pom, and
tried with 
"mvn package war:war" (so it packages a jar and a war...)


I just tried this:

<warSourceExcludes>src/main/webapp/help/**</warSourceExcludes>

nothing changes


with
<webResources>
  <webResource>
    <directory>src/main</directory>
    <excludes>
      <exclude>**/webapp/</exclude>
      <exclude>**/help/</exclude>
      <exclude>webapp</exclude>
    </excludes>
  </webResource>
</webResources>

same story...it just avoid to put a webapp and java directory in the war,
but the help,static,style,...are still there


basically I'd like the war to have the same contents as the jar (pretty
much...)
-- 
View this message in context:
http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24
053693.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




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


Re: Excluding files/webapp folder from a war

Posted by turbo-555 <fd...@ticino.com>.


rynam0 wrote:
> 
> Try something like this?
> 
>         <configuration>
> 
> <warSourceExcludes>src/main/webapp/someExcludedDirectory/**</warSourceExcludes>
>         </configuration>
> 

I removed the "<packaging>war</packaging> at the beginning of the pom, and
tried with 
"mvn package war:war" (so it packages a jar and a war...)


I just tried this:

<warSourceExcludes>src/main/webapp/help/**</warSourceExcludes>

nothing changes


with
<webResources>
  <webResource>
    <directory>src/main</directory>
    <excludes>
      <exclude>**/webapp/</exclude>
      <exclude>**/help/</exclude>
      <exclude>webapp</exclude>
    </excludes>
  </webResource>
</webResources>

same story...it just avoid to put a webapp and java directory in the war,
but the help,static,style,...are still there


basically I'd like the war to have the same contents as the jar (pretty
much...)
-- 
View this message in context: http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24053693.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 files/webapp folder from a war

Posted by Ryan Connolly <ry...@gmail.com>.
Try something like this?

        <configuration>

<warSourceExcludes>src/main/webapp/someExcludedDirectory/**</warSourceExcludes>
        </configuration>

On Tue, Jun 16, 2009 at 8:07 AM, turbo-555 <fd...@ticino.com> wrote:

>
> exactly, I'm trying to find a way or an example how to configure it, and
> the
> doc you posted...I've seen it and went over it several times trying
> different combinations, but it ain't working out.
>
>
> without touching at the plugin, but just setting the packaging to war the
> files that mvn puts in the target are different...(with a jar it doesn't
> pack all those help, images,...folders)
>
> so I tryed configuring as written on the doc, but if I write:
> <webResources>
>  <resource>
>    <directory>src/main</directory>
>    <excludes>
>      <exclude>webapp</exclude>
>    </excludes>
>  </resource>
> </webResources>
>
> it adds even more folders and it doesn't exclude anything
>
> with:
> <webResources>
>  <resource>
>    <excludes>
>      <exclude>webapp</exclude>
>    </excludes>
>  </resource>
> </webResources>
>
>
> it raises a nullpointer at packaging.
>
>
>
>
>
>
>
> rynam0 wrote:
> >
> > It sounds to me like you want to configure the maven-war-plugin with
> > some excludes.   Docs can be found here:
> >
> >
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> >
>
> --
> View this message in context:
> http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24052974.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
>
>


-- 
®¥@N

RE: Excluding files/webapp folder from a war

Posted by Martin Gainty <mg...@hotmail.com>.
http://jira.codehaus.org/browse/MWAR-198

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 16 Jun 2009 05:07:42 -0700
> From: fdurbin@ticino.com
> To: users@maven.apache.org
> Subject: Re: Excluding files/webapp folder from a war
> 
> 
> exactly, I'm trying to find a way or an example how to configure it, and the
> doc you posted...I've seen it and went over it several times trying
> different combinations, but it ain't working out.
> 
> 
> without touching at the plugin, but just setting the packaging to war the
> files that mvn puts in the target are different...(with a jar it doesn't
> pack all those help, images,...folders)
> 
> so I tryed configuring as written on the doc, but if I write:
> <webResources>
>   <resource>
>     <directory>src/main</directory>
>     <excludes>
>       <exclude>webapp</exclude>
>     </excludes>
>   </resource>
> </webResources>
> 
> it adds even more folders and it doesn't exclude anything
> 
> with:
> <webResources>
>   <resource>
>     <excludes>
>       <exclude>webapp</exclude>
>     </excludes>
>   </resource>
> </webResources>
> 
> 
> it raises a nullpointer at packaging.
> 
> 
> 
> 
> 
> 
> 
> rynam0 wrote:
> > 
> > It sounds to me like you want to configure the maven-war-plugin with
> > some excludes.   Docs can be found here:
> > 
> > http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24052974.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
> 

_________________________________________________________________
Bing™  brings you maps, menus, and reviews organized in one place.   Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1

Re: Excluding files/webapp folder from a war

Posted by turbo-555 <fd...@ticino.com>.
exactly, I'm trying to find a way or an example how to configure it, and the
doc you posted...I've seen it and went over it several times trying
different combinations, but it ain't working out.


without touching at the plugin, but just setting the packaging to war the
files that mvn puts in the target are different...(with a jar it doesn't
pack all those help, images,...folders)

so I tryed configuring as written on the doc, but if I write:
<webResources>
  <resource>
    <directory>src/main</directory>
    <excludes>
      <exclude>webapp</exclude>
    </excludes>
  </resource>
</webResources>

it adds even more folders and it doesn't exclude anything

with:
<webResources>
  <resource>
    <excludes>
      <exclude>webapp</exclude>
    </excludes>
  </resource>
</webResources>


it raises a nullpointer at packaging.







rynam0 wrote:
> 
> It sounds to me like you want to configure the maven-war-plugin with
> some excludes.   Docs can be found here:
> 
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> 

-- 
View this message in context: http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24052974.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 files/webapp folder from a war

Posted by Ryan Connolly <ry...@gmail.com>.
It sounds to me like you want to configure the maven-war-plugin with
some excludes.   Docs can be found here:

http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html


On 6/16/09, turbo-555 <fd...@ticino.com> wrote:
>
> Hi all,
>
> I tried using the search, but I haven't found anything that could help me.
>
> I'm building a war package:
> <packaging>war</packaging>..
>
> but I need to keep out of the war the static part of the project, that would
> be the whole webapp folder...
> the structure of my project:
> src:
>   -main:
>     -java
>     -resources
>     -webapp:
>       -help
>       -images
>       -static
>       -style
>       -WEB-INF
>
>
> If I run mvn package I get a war with in it:
> -help
> -images
> -static
> -style
> -...
>
>
> is there a possibility to have mvn exclude these files?
> I tried using the war plugin, but I must have missed something...
>
>
> thanks
>
> --
> View this message in context:
> http://www.nabble.com/Excluding-files-webapp-folder-from-a-war-tp24050485p24050485.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
>
>

-- 
Sent from my mobile device

®¥@N

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