i18n / @PropertyKey()

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

4 comments
Comment actions Permalink

On 2007-09-05 18:56:29 +0400, Johannes Schneider <shake@web.de> said:

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


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.

0
Comment actions Permalink

The properties file is located within the same module. But the usages
are marked red....


Johannes Schneider

Maxim Shafirov wrote:

On 2007-09-05 18:56:29 +0400, Johannes Schneider <shake@web.de> said:

>> 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


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.

0
Comment actions Permalink

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").

The properties file is located within the same
module. But the usages
are marked red....

0
Comment actions Permalink

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:

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").

>> The properties file is located within the same
>> module. But the usages
>> are marked red....

0

Please sign in to leave a comment.