When creating a jar-with-dependencies, the resources in src/test/resources are automatically added to the jar. This folder often contains a .properties file only valid for the test environment and should not be included in the final jar.
resource tag to exclude the directory is ignored by Maven running in Eclipse. It's not clear why.
Right-click the source folder "src/test/resources" and click "Build Path|Configure Exclusion/Inclusion Filters...". Add an exclusion filter of
**. Now the resources will not be included in the final jar file.
When running from eclipse, it is possible to include the content of src/test/resources in the classpath. Here's how:
Now when running from eclipse, the test resources are in the classpath. It maybe necessary to make this change for several launch configurations.