Question: When I create an executable jar with dependencies (using [this guide](https://stackoverflow.com/questions/1814526/problem-building-executable-jar-with-maven/1814697#1814697)), all properties files are packaged into that jar too. How to stop it from happening? Thanks.

UPDATE: I tried to exclude them using the [Maven resources plugin](http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html), but then my application won't find the properties files when I run it in Eclipse (right click on the module -> Run As -> Java Application)

UPDATE: Thanks for your useful answers. I think I'd better spend time to learn Maven, for now I just choose the simplest solution.

Answer: 
Another possibility is to use the [Maven Shade Plugin](https://maven.apache.org/plugins/maven-shade-plugin/), e.g. to exclude a logging properties file used only locally in your IDE:

```
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>${maven-shade-plugin-version}</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>log4j2.xml</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </execution>
    </executions>
</plugin>

```

This will however exclude the files from every artifact, so it might not be feasible in every situation.
> 
> When I create an executable jar with dependencies (using this guide), all properties files are packaged into that jar too. How to stop it from happening? Thanks.
> 
> 
> 

Properties files from where? Your main jar? Dependencies? 

In the former case, putting resources under `src/test/resources` as suggested is probably the most straight forward and simplest option. 

In the later case, you'll have to create a custom assembly descriptor with special `excludes/exclude` in the [`unpackOptions`](http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_unpackOptions).