You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adrian Shum <tc...@taifook.com> on 2006/08/01 05:32:22 UTC

RE: Non-classpath resources filtering?

Thanks a lot for your help.  It works  :)

btw, the reason I want to do this is, I want to have my
application's configuration files put in a normal directory
in file system, and by adding that directory to classpath,
I can change my configurations without extracting them
from the JAR.  In original way that maven handle resources,
configurations are put in JAR which I have to extract them,
modify, and then jar it back.

I am not sure if it is a normal practice.  If not, what is the 
common way to organize configuration files?  I wonder
if everyone is putting all configuration to JAR?

Thanks

-----Original Message-----
From: Pete Marvin King [mailto:last.exile.vanship.pilot@gmail.com]
Sent: Monday, July 31, 2006 9:50 PM
To: Maven Users List
Subject: Re: Non-classpath resources filtering?



Hello,

I don't know why you want to do this but the work around is to add the
following to your pom :

        [...]
            <build>
                  [...]
                  <plugins>
                          <plugin>
                              <groupId>org.apache.maven.plugins</groupId>
                             
<artifactId>maven-resources-plugin</artifactId>
                              <version>2.2</version>
                          </plugin>
                  </plugins>
                   <resources>
                          <resource>
                                <!-- this is relative to your project
root -->
                                <directory>sourceDir</directory>
                                <!-- this is relative to target/classes -->
                                <!-- this dir will land on your project
root -->
                               
<targetPath>../../destinationDir</targetPath>
                                <filtering>true</filtering>
                          </resource>
                          [...]
                   </resources>
                   [...]
             </build>
         [...]

 you can add as many resource entries as you want.  Hope this helps.


pete marvin


Adrian Shum wrote:
> Dear all,
>
> I am new to Maven and I have tried to find related answer but I failed.
>
> Is it possible to perform non-classpath resources filter?
> My application has its own application configs which I don't want to
> put into the JAR.  Instead I want it be put in a separated directory
> to let users able to change directly (which I think I can achieve
> by using maven-assembly-plugin, right?).  I'd like to use filtering
> to generate config files for different environments.
>
> Seems I can only filter resources under <build><resources> in POM.
> However, if resources are put there it will be jarred which is not
> I want.
>
> Is there any suggestion if I want to achieve this?  Thanks.
>
> Best regards,
> Alien
>
>
>
> This email is confidential. If you are not the intended recipient, please delete it from your system and notify the sender immediately. Any unauthorized use, disclosure, dissemination or copying of this email is prohibited. Tai Fook Securities Group, its group companies and their content providers ("Parties") shall not be responsible for the accuracy or completeness of this email or its attachment, if any, which could contain virus, be corrupted, destroyed, incomplete, intercepted, lost or arrive late.   The Parites do not accept liability for any damage caused by this email.
>
>
>   


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



This email is confidential. If you are not the intended recipient, please delete it from your system and notify the sender immediately. Any unauthorized use, disclosure, dissemination or copying of this email is prohibited. Tai Fook Securities Group, its group companies and their content providers ("Parties") shall not be responsible for the accuracy or completeness of this email or its attachment, if any, which could contain virus, be corrupted, destroyed, incomplete, intercepted, lost or arrive late.   The Parites do not accept liability for any damage caused by this email.


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