Hi Janos,
I believe the proper "Maven2 way" of doing this would be with a single
set of files for all deployment environments with variable
substitution using values derived from profiles.
Then you issue "mvn package -P dev" and it uses the values from
profile "dev" when filtering the property files.
Here's an example:
project/web/pom.xml
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
project/profiles.xml
<profilesXml>
<activeProfiles>
<activeProfile>local</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<proj.web.context>/local</proj.web.context>
<proj.web.uri>local.war</proj.web.uri>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<proj.web.context>/proj212</proj.web.context>
<proj.web.uri>web-2.1.2.war</proj.web.uri>
</properties>
</profile>
</profiles>
</profilesXml>
project/web/src/main/resources/META-INF/application.xml
<module>
<web>
<web-uri>${proj.web.uri}</web-uri>
<context-root>${proj.web.context}</context-root>
</web>
</module>
Then when the "filter resources" step occurs, your property values are
substituted for the variables in the resources, depending on which
profile you want to use for this build.
HTH.
Wayne
On 4/18/06, Janos Mucsi <[EMAIL PROTECTED]> wrote:
> Ray
>
> Thanks, I start to understand profiles. However, I
> would like to see how you would use a property that a
> profile sets to copy additional resources. Any sample
> pom.xml?
>
> Let's say my directory structure is like this:
> src
> main
> java
> resources
> devresources
> test
> ..
>
> I would like to (over)write some files from
> devresources over the files coming from resources.
>
> Thanks.
>
> Janos
>
> --- Ray Tsang <[EMAIL PROTECTED]> wrote:
>
> > sound like you should use profiles or resource
> > filters
> >
> >
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> >
> http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%20filter%20resource%20files?
> >
> > ray,
> >
> > On 4/18/06, Janos Mucsi <[EMAIL PROTECTED]> wrote:
> > > Hi
> > > Some resource files are different in
> > development, so I want to overwrite the production
> > files when building for dev.
> > > src
> > > main
> > > java
> > > conf
> > > development
> > > production
> > >
> > >
> > > What is the smartest way to overlay some files?
> > Using an embedded Ant script? Where do I specify the
> > switch condition? On the command line? By the way,
> > what is also the best way to lay out the
> > directories?
> > >
> > >
> > > Thanks.
> > > Janos
> > >
> > >
> > > ---------------------------------
> > > Love cheap thrills? Enjoy PC-to-Phone calls to
> > 30+ countries for just 2ยข/min with Yahoo! Messenger
> > with Voice.
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>