I'm working on a Swing application that has to be localized.
For that purpose, I'm using a resourceBundle. It works fine when I run the application from the IDE. But when I use maven to generate the jar, the application starts up normally but the internationalization stops working. Without throwing any exception, I have make a lot of variations to solve that problem; I even have make a class that inherits from java.util.ResourceBundle.Control. The only thing I've achieved to make it work is by placing the properties files outside the package (I place it into the desktop just for testing). I then try to use the same method by specifying the path by new File(".").getAbsolutePath().
Doing that still keeps working from running it from Eclipse, but when I try to generate the jar and execute it, it throws an exception and the application does not start.
If you place your properties file into src/main/java next to the Java code, Maven will probably not pick it up.
The canonical location would be src/main/resources (with the package structure below that duplicated just as it is now in your code).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With