Am Montag, 11. Juni 2007 16:40 schrieb Dirk Olmes:
> Nathan Maves wrote:
> > First off great product!
> >
> > I am using filtering for all of my property files that differ from
> > multiple environments (dev, uat, prod).  I am a little stuck on how to
> > filter files that differ dramatically from env to env.  One such file is
> > a log4j properties file.  We have very different files depending on env. 
> > Is there any way, without using ant, to copy these files to the target
> > directories based on which profile is used.
>
> One way would be to define profiles for your various environments. In
> each profile, configure the resources section. (A look at
> http://maven.apache.org/ref/current/maven-model/maven.html helps how to
> do that).

i use filtering AND special resource directories:

        <profiles>
                <profile>
                        <id>development</id>
                        <activation>
                                <property>
                                        <name>env</name>
                                        <value>development</value>
                                </property>
                        </activation>
                        <build>
                                <resources>
                                        <resource>
                                                <filtering>true</filtering>
                                                
<directory>src/main/resources/</directory>
                                        </resource>
                                        <resource>
                                                <filtering>true</filtering>
                                                <directory>
                                                        
src/main/development-resources
                                                </directory>
                                        </resource>
                                </resources>
                        </build>
                        <properties>
                                <hibernate.show_sql>true</hibernate.show_sql>
                                
<hibernate.format_sql>true</hibernate.format_sql>
                        </properties>
                </profile>
        </profiles>

In your main build section:
        <build>
                <resources>
                        <resource>
                                <filtering>true</filtering>
                                <directory>src/main/resources/</directory>
                        </resource>
                </resources>
        </build>

You can have a log4j.properties in src/main/resources and in 
src/main/development-resources and the first one gets overwritten by the 
second one IF development profil is active

kind regards,
Janning



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to