You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yuvaraj Vanarase <yu...@synechron.com> on 2011/07/06 11:49:21 UTC

Skip Resources for War

Hi,

I have few XML files under src/main/resources. The project packging is War. I would like to avoid these files getting into War file.  I could exclude them from being part of target/classes by using resources & exclude inside build tag.
Any clue how to skip them for war?

Well, copying them into some external resources directory would solve the purpose, however if to be done with present settings.

Regards,
Yuvaraj

Yuvaraj Vanarase,
Lead Technology - Software
Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | http://www.synechron.com
SYNECHRON -
- Top 10 Best IT Employers for 4 consecutive years (link<http://www.synechron.com/news/news_best_employer_sep2010.htm>).
- Celebrating 10 Years!


Re: Skip Resources for War

Posted by Stephen Connolly <st...@gmail.com>.
did you do a "mvn clean" after you made the change to the pom?

On 6 July 2011 12:46, Yuvaraj Vanarase <yu...@synechron.com>wrote:

> Yeah.
>
>
>
> I tried using:
>
>            <resources>
>
>                        <resource>
>
>                        <directory>src/main/resources</directory>
>
>                        <filtering>false</filtering>
>
>                                    <excludes>
>
>                                                <exclude>**/*.*</exclude>
>
>                                    </excludes>
>
>                        </resource>
>
> Under build tag. It does avoid copying files into target/classes directory,
> however built War file does have them under WEB-INF/classes.
>
>
>
> Using:
>
>
>
> <webResources>
>
>     <resource>
>
>                  <directory>${basedir}/src/main/resources</directory>
>
>                  <excludes>
>
>                         <exclude>**/*.*</exclude>
>
>                  </excludes>
>
>                </resource>
>
>  </webResources>
>
>
>
> Inside War plug-in configuration  doesn't help either.
>
>
>
> Any suggestions?
>
>
>
>
>
> Regards,
>
> Yuvaraj
>
>
>
> Yuvaraj Vanarase,
>
> Lead Technology - Software
>
> Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 |
> http://www.synechron.com
>
> SYNECHRON -
>
> - Top 10 Best IT Employers for 4 consecutive years (link).
>
> - Celebrating 10 Years!
>
>
>
> -----Original Message-----
> From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
> Sent: Wednesday, July 06, 2011 3:26 PM
> To: Maven Users List
> Subject: Re: Skip Resources for War
>
>
>
> 2011/7/6 Yuvaraj Vanarase <yu...@synechron.com>
>
>
>
> > I have few XML files under src/main/resources. The project packging is
> War.
>
> > I would like to avoid these files getting into War file.  I could exclude
>
> > them from being part of target/classes by using resources & exclude
> inside
>
> > build tag.
>
> > Any clue how to skip them for war?
>
> >
>
>
>
> Resources in src/main/resources will be put in WEB-INF/classes and they can
>
> be excluded like you did for Jar-packaged projects.
>
> Did you try it? Didn't it work?
>
>
>
> Antonio
>

RE: Skip Resources for War

Posted by Yuvaraj Vanarase <yu...@synechron.com>.
Well, need to add <directory>${basedir}/src/main/resources</directory> under resources, else it gives NullPointer.
I tried again and now its working. No clue why it wasn't working earlier.  Thanks Martin.

Regards,
Yuvaraj

Yuvaraj Vanarase,
Lead Technology - Software
Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | http://www.synechron.com
SYNECHRON - 
- Top 10 Best IT Employers for 4 consecutive years (link).
- Celebrating 10 Years!


-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Wednesday, July 06, 2011 5:45 PM
To: users@maven.apache.org
Subject: RE: Skip Resources for War


 <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <!-- exclude all resources -->
              <excludes>
                <exclude>**/*.*</exclude>
              </excludes>
            </resource>
          </webResources>
        </configuration>
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
does this not work for you?
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

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.


> From: yuvaraj.vanarase@synechron.com
> To: users@maven.apache.org
> Date: Wed, 6 Jul 2011 06:46:41 -0500
> Subject: RE: Skip Resources for War
> 
> Yeah.
> 
> 
> 
> I tried using:
> 
>             <resources>
> 
>                         <resource>
> 
>                         <directory>src/main/resources</directory>
> 
>                         <filtering>false</filtering>
> 
>                                     <excludes>
> 
>                                                 <exclude>**/*.*</exclude>
> 
>                                     </excludes>
> 
>                         </resource>
> 
> Under build tag. It does avoid copying files into target/classes directory, however built War file does have them under WEB-INF/classes.
> 
> 
> 
> Using:
> 
> 
> 
> <webResources>
> 
>      <resource>
> 
>                   <directory>${basedir}/src/main/resources</directory>
> 
>                   <excludes>
> 
>                          <exclude>**/*.*</exclude>
> 
>                   </excludes>
> 
>                 </resource>
> 
>   </webResources>
> 
> 
> 
> Inside War plug-in configuration  doesn't help either.
> 
> 
> 
> Any suggestions?
> 
> 
> 
> 
> 
> Regards,
> 
> Yuvaraj
> 
> 
> 
> Yuvaraj Vanarase,
> 
> Lead Technology - Software
> 
> Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | http://www.synechron.com
> 
> SYNECHRON -
> 
> - Top 10 Best IT Employers for 4 consecutive years (link).
> 
> - Celebrating 10 Years!
> 
> 
> 
> -----Original Message-----
> From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
> Sent: Wednesday, July 06, 2011 3:26 PM
> To: Maven Users List
> Subject: Re: Skip Resources for War
> 
> 
> 
> 2011/7/6 Yuvaraj Vanarase <yu...@synechron.com>
> 
> 
> 
> > I have few XML files under src/main/resources. The project packging is War.
> 
> > I would like to avoid these files getting into War file.  I could exclude
> 
> > them from being part of target/classes by using resources & exclude inside
> 
> > build tag.
> 
> > Any clue how to skip them for war?
> 
> >
> 
> 
> 
> Resources in src/main/resources will be put in WEB-INF/classes and they can
> 
> be excluded like you did for Jar-packaged projects.
> 
> Did you try it? Didn't it work?
> 
> 
> 
> Antonio
 		 	   		  

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


RE: Skip Resources for War

Posted by Martin Gainty <mg...@hotmail.com>.
 <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <!-- exclude all resources -->
              <excludes>
                <exclude>**/*.*</exclude>
              </excludes>
            </resource>
          </webResources>
        </configuration>
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
does this not work for you?
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

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.


> From: yuvaraj.vanarase@synechron.com
> To: users@maven.apache.org
> Date: Wed, 6 Jul 2011 06:46:41 -0500
> Subject: RE: Skip Resources for War
> 
> Yeah.
> 
> 
> 
> I tried using:
> 
>             <resources>
> 
>                         <resource>
> 
>                         <directory>src/main/resources</directory>
> 
>                         <filtering>false</filtering>
> 
>                                     <excludes>
> 
>                                                 <exclude>**/*.*</exclude>
> 
>                                     </excludes>
> 
>                         </resource>
> 
> Under build tag. It does avoid copying files into target/classes directory, however built War file does have them under WEB-INF/classes.
> 
> 
> 
> Using:
> 
> 
> 
> <webResources>
> 
>      <resource>
> 
>                   <directory>${basedir}/src/main/resources</directory>
> 
>                   <excludes>
> 
>                          <exclude>**/*.*</exclude>
> 
>                   </excludes>
> 
>                 </resource>
> 
>   </webResources>
> 
> 
> 
> Inside War plug-in configuration  doesn't help either.
> 
> 
> 
> Any suggestions?
> 
> 
> 
> 
> 
> Regards,
> 
> Yuvaraj
> 
> 
> 
> Yuvaraj Vanarase,
> 
> Lead Technology - Software
> 
> Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | http://www.synechron.com
> 
> SYNECHRON -
> 
> - Top 10 Best IT Employers for 4 consecutive years (link).
> 
> - Celebrating 10 Years!
> 
> 
> 
> -----Original Message-----
> From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
> Sent: Wednesday, July 06, 2011 3:26 PM
> To: Maven Users List
> Subject: Re: Skip Resources for War
> 
> 
> 
> 2011/7/6 Yuvaraj Vanarase <yu...@synechron.com>
> 
> 
> 
> > I have few XML files under src/main/resources. The project packging is War.
> 
> > I would like to avoid these files getting into War file.  I could exclude
> 
> > them from being part of target/classes by using resources & exclude inside
> 
> > build tag.
> 
> > Any clue how to skip them for war?
> 
> >
> 
> 
> 
> Resources in src/main/resources will be put in WEB-INF/classes and they can
> 
> be excluded like you did for Jar-packaged projects.
> 
> Did you try it? Didn't it work?
> 
> 
> 
> Antonio
 		 	   		  

RE: Skip Resources for War

Posted by Yuvaraj Vanarase <yu...@synechron.com>.
Yeah.



I tried using:

            <resources>

                        <resource>

                        <directory>src/main/resources</directory>

                        <filtering>false</filtering>

                                    <excludes>

                                                <exclude>**/*.*</exclude>

                                    </excludes>

                        </resource>

Under build tag. It does avoid copying files into target/classes directory, however built War file does have them under WEB-INF/classes.



Using:



<webResources>

     <resource>

                  <directory>${basedir}/src/main/resources</directory>

                  <excludes>

                         <exclude>**/*.*</exclude>

                  </excludes>

                </resource>

  </webResources>



Inside War plug-in configuration  doesn't help either.



Any suggestions?





Regards,

Yuvaraj



Yuvaraj Vanarase,

Lead Technology - Software

Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | http://www.synechron.com

SYNECHRON -

- Top 10 Best IT Employers for 4 consecutive years (link).

- Celebrating 10 Years!



-----Original Message-----
From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
Sent: Wednesday, July 06, 2011 3:26 PM
To: Maven Users List
Subject: Re: Skip Resources for War



2011/7/6 Yuvaraj Vanarase <yu...@synechron.com>



> I have few XML files under src/main/resources. The project packging is War.

> I would like to avoid these files getting into War file.  I could exclude

> them from being part of target/classes by using resources & exclude inside

> build tag.

> Any clue how to skip them for war?

>



Resources in src/main/resources will be put in WEB-INF/classes and they can

be excluded like you did for Jar-packaged projects.

Did you try it? Didn't it work?



Antonio

Re: Skip Resources for War

Posted by Antonio Petrelli <an...@gmail.com>.
2011/7/6 Yuvaraj Vanarase <yu...@synechron.com>

> I have few XML files under src/main/resources. The project packging is War.
> I would like to avoid these files getting into War file.  I could exclude
> them from being part of target/classes by using resources & exclude inside
> build tag.
> Any clue how to skip them for war?
>

Resources in src/main/resources will be put in WEB-INF/classes and they can
be excluded like you did for Jar-packaged projects.
Did you try it? Didn't it work?

Antonio

Re: Skip Resources for War

Posted by Vincent Latombe <vi...@gmail.com>.
Hello,

You have to use
http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html

webResources are meant to be web resources (jsp, js, html....) not resources
present in the classpath (WEB-INF/classes)

Vincent


On Wed, Jul 6, 2011 at 18:01, Wayne Fay <wa...@gmail.com> wrote:

> > Well, copying them into some external resources directory would solve the
> purpose, however if to be done with present settings.
>
> I don't know why you don't just move the files to
> /src/external/resources or something. That seems to be the easiest
> solution.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Skip Resources for War

Posted by Wayne Fay <wa...@gmail.com>.
> Well, copying them into some external resources directory would solve the purpose, however if to be done with present settings.

I don't know why you don't just move the files to
/src/external/resources or something. That seems to be the easiest
solution.

Wayne

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