i18n / @PropertyKey() Follow
Hi,
I use the @PropertyKey annotation a lot. Unfortunately every resource
key is marked red since my properties file is not located within the
same source file as the java file. I use the maven directory layout.
I am sure that some EAPs ago this has worked fine.
Is it a bug or a feature? Does there exist a workaround?
Johannes Schneider
Please sign in to leave a comment.
On 2007-09-05 18:56:29 +0400, Johannes Schneider <shake@web.de> said:
This inspection honors dependency between modules so your property file
must reside in a source root of the module, which listed in dependency
list of the client module.
The properties file is located within the same module. But the usages
are marked red....
Johannes Schneider
Maxim Shafirov wrote:
>> Hi,
>>
>> I use the @PropertyKey annotation a lot. Unfortunately every resource
>> key is marked red since my properties file is not located within the
>> same source file as the java file. I use the maven directory layout.
>> I am sure that some EAPs ago this has worked fine.
>>
>> Is it a bug or a feature? Does there exist a workaround?
>>
>>
>> Johannes Schneider
Johannes,
This is working fine here, even if the properties file is located in a different module. You have to make sure that:
- the properties file is in a directory marked as a source root;
- the PropertyKey annotation is using classpath notation.
Here's an example:
module_dir/
rsc/ <--- this is marked as source root
resources/
example.properties
Then you should use @PropertyKey(resourceBundle="resources.example").
Hi,
thanks for your reply. My configuration seems to be ok. And it did work
some EAPs ago.
Today I tried the latest EAP: And everything looks good today....
So I think this was some kind of cache related problem ;)
Regards,
Johannes Schneider
Martin Fuhrer wrote:
>> The properties file is located within the same
>> module. But the usages
>> are marked red....