I use maven to create a runnable jar from multiple projects :
Project A (contains the Main class):
/src/main/resources/META-INF/resources/a.txt
Project B (depends on Project A):
/src/main/resources/META-INF/resources/b.txt
Runnable.jar (create with mvn):
/src/main/resources/META-INF/resources/a.txt
,/src/main/resources/META-INF/resources/b.txt
In the Main class I use Class.class.getResource
to get the content of a.txt and b.txt.
When I do java -jar Runnable.jar
, I can access to a.txt and b.txt. But if I run it from Eclipse, I can only access to a.txt . Is it possible to get it right? I'd like to change resources content when the application is running and get the result without recompiling.
The Run configuration : [MAIN] => Project : Poject B, Main class : Main [ClassPath] => UserEntry : Project A, Project B
NB : If I change the order of the UserEntry, I can access to b.txt but not a.txt.
Could you help me?