[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.m2e] Specifying resources for runtime usage?

I have some xml files in a maven module in:

src/main/resources

which is loaded in my application with:

   URL url = this.getClass().getClassLoader().getResource("somexml.xml");

When running my application from eclipse the files are found and used correctly.

When I build my application using "mvn install" and then run it those resources are not found/used. I have opened the .jar files (created during the packaging) and the resources are included. I have also tried to add:

  <build>
  <resources>
    <resource>
      <directory> src\main\resources</directory>
    </resource>
  </resources>
  </build>

to the pom.xml file but that does not help.

Any ideas on how to use resources from the packaged jar files when running an application?