title: wildfly: reading properties from configuration directory
body: <p>I'm trying to read deployment specific information from a properties file in my wildfly configuration folder. I tried this:</p>
  
  <pre><code>@Singleton
  @Startup
  public class DeploymentConfiguration {
  
    protected Properties props;
  
    @PostConstruct
    public void readConfig() {
  
      props = new Properties();
      try {
        props.load(getClass().getClassLoader().getResourceAsStream("my.properties"));
      } catch (IOException e) {
        // ... whatever
      }
    }
  </code></pre>
  
  <p>But apparently this is not working since the configuration folder is not in the classpath anymore. Now I can't find an easy way to do it. My favorite would be something like this:</p>
  
  <pre><code>@InjectProperties("my.properties")
  protected Properties props;
  </code></pre>
  
  <p>The only solution I found on the web so far involves making my own OSGi module, but I believe there must be an easier way to do it (one without OSGi!). Can anyone show me how?</p>