You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nathan Maves <na...@gmail.com> on 2007/06/14 22:59:22 UTC
Resource files are not overwritten
I have two resource directories set up via...
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/resources-${env}</directory>
</resource>
</resources>
The env var is set via a selected profile. The problem occurs when there is
a file in both of the resources directories. I would expect the one in the
second directory would over write the first but this is not the case. It is
always ignored. If I remove the resource from the first directory then the
resource with the same name is used from the second resource directory.
Any ideas?
Nathan
Re: Resource files are not overwritten
Posted by Nathan Maves <na...@gmail.com>.
In a profile.
<profile>
<id>env-qa</id>
<activation>
<property>
<name>env</name>
<value>qa</value>
</property>
</activation>
<properties>
<env>qa</env>
</properties>
</profile>
<profile>
<id>env-prod</id>
<activation>
<property>
<name>env</name>
<value>prod</value>
</property>
</activation>
<properties>
<env>prod</env>
</properties>
</profile>
Like I said this works fine because it will pick up all the files in the
resources-${env} directory as long as they are not in the standard resources
directory.
Nathan
On 6/14/07, Mick Knutson <mi...@gmail.com> wrote:
>
> where is ${env} defined?
>
>
> On 6/14/07, Nathan Maves <na...@gmail.com> wrote:
> >
> > I have two resource directories set up via...
> >
> >
> > <resources>
> > <resource>
> > <directory>src/main/resources</directory>
> > </resource>
> > <resource>
> > <directory>src/main/resources-${env}</directory>
> > </resource>
> > </resources>
> >
> > The env var is set via a selected profile. The problem occurs when
> there
> > is
> > a file in both of the resources directories. I would expect the one in
> > the
> > second directory would over write the first but this is not the
> case. It
> > is
> > always ignored. If I remove the resource from the first directory then
> > the
> > resource with the same name is used from the second resource directory.
> >
> > Any ideas?
> >
> > Nathan
> >
>
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>
Re: Resource files are not overwritten
Posted by Mick Knutson <mi...@gmail.com>.
where is ${env} defined?
On 6/14/07, Nathan Maves <na...@gmail.com> wrote:
>
> I have two resource directories set up via...
>
>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> </resource>
> <resource>
> <directory>src/main/resources-${env}</directory>
> </resource>
> </resources>
>
> The env var is set via a selected profile. The problem occurs when there
> is
> a file in both of the resources directories. I would expect the one in
> the
> second directory would over write the first but this is not the case. It
> is
> always ignored. If I remove the resource from the first directory then
> the
> resource with the same name is used from the second resource directory.
>
> Any ideas?
>
> Nathan
>
--
---
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---