dev@glassfish.java.net

Re: [GFv3] Keep .properties file in resources dir instead of java dir

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Fri, 12 Sep 2008 15:46:38 -0700

Lloyd Chambers wrote:
> I'd like some clarification on the best-practices idiom here. Suppose
> I have the packages:
>
> org.glassfish.fish
> org.glassfish.fish.nostones
> org.glassfish.fish.notafish
>
> corresponding to directories:
>
> src/main/java/org/glassfish/fish
> src/main/java/org/glassfish/fish/nostones
> src/main/java/org/glassfish/fish/notafish
>
> All 3 packages want logging strings.
>
> 1) Should there be 3 logging.properties files, one for each package?
> Or one file covering "fish"?
>
> 2) Must the hierarchy under resources/ match exactly eg must it be:
>
> src/main/resources/org/glassfish/fish/logging.properties
> src/main/resources/org/glassfish/fish/nostones/logging.properties
> src/main/resources/org/glassfish/fish/notafish/logging.properties
>
> Or is there something simpler?
you should have only one resource bundle, at the top of you hierarchy.
Remember that your logger is (at least so far) associated with only one
resource bundle (which itself is associated with one
logging.properties). So you want your logger initialized with
logging.properties instance which will allow it to load all the
resources it will log.

Jerome
>
> Lloyd
>
>
> On Sep 12, 2008, at 3:16 PM, Jerome Dochez wrote:
>
>> Carla Mott wrote:
>>> I started down that path when I moved a few of the
>>> LogStrings.properties files but noticed that in the pom.xml the
>>> resources element was pointing to the src/main/java directory.
>>> looking under that dir you may find LocalStrings.properties files or
>>> other resource files. It seems that different modules do things
>>> differently.
>>>
>>> This doesn't answer why it's done the way it is but this is why I
>>> continued with the current strategy.
>> we shouldn't continue in that strategy, it was like this in v2 and we
>> did not disrupt it when moving the code (that's why we had to had
>> entries in the pom.xml).
>>
>> maven practices is saying we should move those resources into
>> src/main/resources
>>
>> each module should do it at its pace, now when moving and adding,
>> it's a good time to pick up good habits.
>> at the very least, we shouldn't find them in both places... once you
>> start moving/adding please move all of them.
>>
>> Jerome
>>>
>>> Carla
>>>
>>> Sahoo wrote:
>>>> I see some LogStrings.properties file added to src/main/java
>>>> instead of src/main/resources. Why? All resources should be kept in
>>>> resources dir.
>>>>
>>>> Thanks,
>>>> Sahoo
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>