Properties properties = new Properties();
URL url = new App().getClass().getResource(PROPERTIES_FILE);
properties.load(url.openStream());
maven-assembly-plugin
2.2
jar-with-dependencies
com.stackoverflow.App
.
make-assembly
package
single
java -cp .;filename.jar com.example.YourClassWithMain
URL root = getClass().getProtectionDomain().getCodeSource().getLocation();
URL propertiesFile = new URL(root, "filename.properties");
Properties properties = new Properties();
properties.load(propertiesFile.openStream());
Class-Path: .
maven-jar-plugin
src/main/java
**/*properties
[....]