You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ws...@gmail.com> on 2005/11/19 17:10:29 UTC
[m2] Need to duplicate a file during build
In src/main/resources, I have several .properties files:
org.apache/.../ApplicationResources.properties
org.apache/.../ApplicationResources_ja.properties
org.apache/.../ApplicationResources_en.properties
As part of the build I need to duplicate
ApplicationResources.properties as ApplicationResources_en.properties
so that I end up with four .properties files under target/classes.
I can't seem to get it done with <resource> as there is only
<targetPath> and not <targetFile> (which wouldn't make sense if
multiple files were picked up with <include>.)
Is there a way to accomplish this?
Thanks,
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Arik Kfir <ar...@gmail.com>.
yes, that's what I meant too :)
good luck...
On 11/19/05, Ashley Williams <ag...@mac.com> wrote:
> In that case english is your default which means your files should
> work as is.
> In other words if the english locale is requested the _en file won't
> be found
> and so the root will be used ApplicationResources.properties.
>
> Of course if as part of your design you want _en and default to have
> separate
> lives then I believe you will have to write a plugin ;)
>
> - Ashley
>
>
> On 19 Nov 2005, at 17:23, Wendy Smoak wrote:
>
> > On 11/19/05, Ashley Williams <ag...@mac.com> wrote:
> >> If this is for resource bundles then don't you already have the
> >> correct files?
> >
> > No, just a typo... I have:
> > org.apache/.../ApplicationResources.properties
> > org.apache/.../ApplicationResources_ja.properties
> > org.apache/.../ApplicationResources_ru.properties
> > and need to duplicate the default one as _en to make four.
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Ashley Williams <ag...@mac.com>.
In that case english is your default which means your files should
work as is.
In other words if the english locale is requested the _en file won't
be found
and so the root will be used ApplicationResources.properties.
Of course if as part of your design you want _en and default to have
separate
lives then I believe you will have to write a plugin ;)
- Ashley
On 19 Nov 2005, at 17:23, Wendy Smoak wrote:
> On 11/19/05, Ashley Williams <ag...@mac.com> wrote:
>> If this is for resource bundles then don't you already have the
>> correct files?
>
> No, just a typo... I have:
> org.apache/.../ApplicationResources.properties
> org.apache/.../ApplicationResources_ja.properties
> org.apache/.../ApplicationResources_ru.properties
> and need to duplicate the default one as _en to make four.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Arik Kfir <ar...@gmail.com>.
well, this is not for the maven mailing list, but in general I
disagree with your Ant file ;-) I'm for NOT duplicating things, as it
brings additional maintainance overhead. If your message changes - you
need to update both the '_en' AND the default file...and since I
assume the default file (AppResources.properties) is already in
english, why duplicate it?
On 11/19/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/19/05, Ashley Williams <ag...@mac.com> wrote:
> > If this is for resource bundles then don't you already have the
> > correct files?
>
> No, just a typo... I have:
> org.apache/.../ApplicationResources.properties
> org.apache/.../ApplicationResources_ja.properties
> org.apache/.../ApplicationResources_ru.properties
> and need to duplicate the default one as _en to make four.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Wendy Smoak <ws...@gmail.com>.
On 11/19/05, Ashley Williams <ag...@mac.com> wrote:
> If this is for resource bundles then don't you already have the
> correct files?
No, just a typo... I have:
org.apache/.../ApplicationResources.properties
org.apache/.../ApplicationResources_ja.properties
org.apache/.../ApplicationResources_ru.properties
and need to duplicate the default one as _en to make four.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Ashley Williams <ag...@mac.com>.
If this is for resource bundles then don't you already have the
correct files?
In other words for _en and _ja locales the corresponding property
files will be found
and then for any other locale the default file will be used, ie
ApplicationResources.properties.
org.apache/.../ApplicationResources.properties
org.apache/.../ApplicationResources_ja.properties
org.apache/.../ApplicationResources_en.properties
Not sure what name you want for the fourth file.
In fact if the default is english then you could even remove the
_en.properties file.
- AW
On 19 Nov 2005, at 17:02, Wendy Smoak wrote:
> On 11/19/05, Arik Kfir <ar...@gmail.com> wrote:
>> I don't think there's a way to do this with maven alone (maven team,
>> correct me?).
>>
>> However, you can create a small plugin that binds to the
>> 'generate-sources' phase and generates the properties you need.
>
> Time to learn how to write plugins, then. :) I figured this was
> coming...
>
>> OTH - this looks like a resource bundle - and if I'm not mistaken,
>> the
>> resource bundle is supposed to look for "parent" bundles if it can't
>> find a bundle in your locale. So, if your locale is 'en', and it
>> can't
>> find 'xxx_en.properties', it should look for 'xxx.properties' - see
>> the JDK java.util.ResourceBundle for details (and if this is not for
>> Resourcebundle - ignore this :))
>
> It is... but the comment in the Ant build file says "Copy the default
> message bundle to avoid problems if the server locale is not English."
> And I don't know enough about it to argue the point.
>
> Thanks!
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Wendy Smoak <ws...@gmail.com>.
On 11/19/05, Arik Kfir <ar...@gmail.com> wrote:
> I don't think there's a way to do this with maven alone (maven team,
> correct me?).
>
> However, you can create a small plugin that binds to the
> 'generate-sources' phase and generates the properties you need.
Time to learn how to write plugins, then. :) I figured this was coming...
> OTH - this looks like a resource bundle - and if I'm not mistaken, the
> resource bundle is supposed to look for "parent" bundles if it can't
> find a bundle in your locale. So, if your locale is 'en', and it can't
> find 'xxx_en.properties', it should look for 'xxx.properties' - see
> the JDK java.util.ResourceBundle for details (and if this is not for
> Resourcebundle - ignore this :))
It is... but the comment in the Ant build file says "Copy the default
message bundle to avoid problems if the server locale is not English."
And I don't know enough about it to argue the point.
Thanks!
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Need to duplicate a file during build
Posted by Arik Kfir <ar...@gmail.com>.
I don't think there's a way to do this with maven alone (maven team,
correct me?).
However, you can create a small plugin that binds to the
'generate-sources' phase and generates the properties you need.
OTH - this looks like a resource bundle - and if I'm not mistaken, the
resource bundle is supposed to look for "parent" bundles if it can't
find a bundle in your locale. So, if your locale is 'en', and it can't
find 'xxx_en.properties', it should look for 'xxx.properties' - see
the JDK java.util.ResourceBundle for details (and if this is not for
Resourcebundle - ignore this :))
On 11/19/05, Wendy Smoak <ws...@gmail.com> wrote:
> In src/main/resources, I have several .properties files:
>
> org.apache/.../ApplicationResources.properties
> org.apache/.../ApplicationResources_ja.properties
> org.apache/.../ApplicationResources_en.properties
>
> As part of the build I need to duplicate
> ApplicationResources.properties as ApplicationResources_en.properties
> so that I end up with four .properties files under target/classes.
>
> I can't seem to get it done with <resource> as there is only
> <targetPath> and not <targetFile> (which wouldn't make sense if
> multiple files were picked up with <include>.)
>
> Is there a way to accomplish this?
>
> Thanks,
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org