7 comments

The documentation indicates that if there are several .properties files in the same folder differing by globalization encodings IntelliJ "automatically" recognizes these as a resource bundle. The examples show how to get properties from a resource bundle. What if I only have one property file and Intellij has not identified it as a resource bundle. How do I access those properties? Also is there any specific location that I need to put the .properties file in? I am assuming that this is a manual process initially creating the property file and filling it with content?

0

The documentation indicates that if there are several .properties files in the same folder differing by globalization encodings IntelliJ "automatically" recognizes these as a resource bundle. The examples show how to get properties from a resource bundle. What if I only have one property file and Intellij has not identified it as a resource bundle.

Then the ide doesn't show a resource bundle editor and you work with a single *.properties file

How do I access those properties?

Are you asking about java code which is used to read/write property values?

Also is there any specific location that I need to put the .properties file in?

It just needs to be located under a source root.

I am assuming that this is a manual process initially creating the property file and filling it with content?

Yes

0

I just add a file with the .properties suffix? Any particular folder? Will it be include in the artifact (.jar)?

0

I just add a file with the .properties suffix?

Yes

Any particular folder?

Please see my comment about source root above

Will it be include in the artifact (.jar)?

It depends on your artifact setup

Denis

0

I see "content root" but not source root. Is source root the folder where the main class is?

As far as the artifact setup. To select a .Jar artifact you masically only have the options to "Create from modules with dependencies". Then I have been told that since this is a Maven project I have to select "Copy to output directory and link with manifest". So that is how the artifact is setup. Now will the .properties be included in the ..jar?

0

I see "content root" but not source root. Is source root the folder where the main class is?

It's a 'blue folder' under content root, check the reference page I provided earlier.

As far as the artifact setup. To select a .Jar artifact you masically only have the options to "Create from modules with dependencies". Then I have been told that since this is a Maven project I have to select "Copy to output directory and link with manifest". So that is how the artifact is setup. Now will the .properties be included in the ..jar?

All module resources which are located under a source root will be included to the artifact then

Denis

0

Please sign in to leave a comment.