You can try this workaround:
Add this into Application
/**
* {@inheritDoc}
*/
@Override
public List<Wave> getPreBootWaveList() {
return Collections.singletonList(
WaveBuilder.create()
.waveGroup(WaveGroup.CALL_COMMAND)
.relatedClass(LoadPropertiesCommand.class)
.build());
}
Add this command
public class LoadPropertiesCommand extends DefaultCommand {
/**
* {@inheritDoc}
*/
@Override
protected void perform(Wave wave) throws CommandException {
ParameterBuilder paramBuilder = ResourceBuilders.PARAMETER_BUILDER;
try {
Method m = ParameterBuilder.class.getMethod("readPropertiesFile", String.class);
m.invoke(paramBuilder, "jrebirth.properties");// enter the relative file path that could be digested by new File
} catch (NoSuchMethodException|SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
MessageBuilder messageBuilder = ResourceBuilders.MESSAGE_BUILDER;
try {
Method m = MessageBuilder.class.getMethod("readPropertiesFile", String.class);
m.invoke(messageBuilder, "Messages_rb.properties");// enter the relative file path that could be digested by new File (copy file where they can be accessed (same jar))
} catch (NoSuchMethodException|SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
}
}
I cannot test it before tonight
but the big deal will be to know how get a local file path string readable (try to your properties aside your command class).
Otherwise we will need to directly inject resource bundle into the array list by reflection, a bit harder but possible.
Seb