I have a similar problem. I could not solve it the way Eclipse does, but I found a solution.
The only solution I found was to include a link to the project / resources in the pom file. This may include a resource tag inside an assembly tag.
<build> ... <resources> <resource> <directory>path/to/resources</directory> <filtering>false</filtering> </resource> </resources>
If you need resources for testing, you can do the following:
... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.9</version> <configuration> <additionalClasspathElements> <additionalClasspathElement>path/to/additional/resources</additionalClasspathElement> <additionalClasspathElement>path/to/additional/jar</additionalClasspathElement> </additionalClasspathElements> </configuration> </plugin> </plugins> </build> ...
The problem that I see in this solution is that I have to add the resource path and commit this change to pom. Any other developer who can have these resources in a separate folder will need to change pom to indicate the location of their resources.
By the way, I got some of this solution from the next conversation.
http://maven.40175.n5.nabble.com/How-to-add-a-folder-to-the-classpath-used-during-maven-build-td4754387.html
source share