In maven how can I include non-java src files in the same place in the output jar?

jar, maven

Solution

You could add the following in your pom indicating that the resources are available in `src/main/java` and `including` the type of resources.

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.properties</include>
            </includes>
        </resource>
    </resources>
</build>

Problem

I received a source code bundle. Inside the src directory tree there are some properties files(.properties) which I want to keep in the output jar in the same place. e.g: I want ``` src/main/java/com.mycompany/utils/Myclass.java src/main/java/com.mycompany/utils/Myclass.properties ``` to stay the same in the jar: ``` com.mycompany/utils/Myclass.class com.mycompany/utils/Myclass.properties ``` without needing to add the properties file it to separate resources folder. Is there a way to I tell this to maven?

Original source