Search Results

Search found 1 results on 1 pages for 'apryor48'.

Page 1/1 | 1 

  • Load properties file in JAR?

    - by apryor48
    I'm having trouble when one of the jars that my web app depends on tries to load a properties file from within the jar. Here is the code in the jar. static { Properties props = new Properties(); try { props.load(ClassLoader.getSystemResourceAsStream("someProps.properties")); } catch (IOException e) { e.printStackTrace(); } someProperty = props.getProperty("someKey"); } The properties file is in my "src/main/resources" directory of the Maven project. When I run this code from my junit test in Eclipse, it executes just fine. When the project is built with Maven into a jar, and included as a dependency in my webb app, it fails to locate the properties file. I know that the properties file is at the base directory of the depended on jar, I don't know how to fix this. Please help!

    Read the article

1