I have \src\main\resources\logback.xml file. When I run mvn package
it is placed into the jar by default. How do I make Maven place it next to jar, not inside?
So, well, I just want Maven to copy the resource to the same folder where jar will be.
I have \src\main\resources\logback.xml file. When I run mvn package
it is placed into the jar by default. How do I make Maven place it next to jar, not inside?
So, well, I just want Maven to copy the resource to the same folder where jar will be.
You can build a ZIP file containing both using the Maven Assembly plugin.
You can also use Maven Antrun plugin or similar to put whatever file you want but the idea of single artifact per project is built deep into Maven internals so there is a chance it will hunt you down elsewhere.
Exclude that file: http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
And then use the Maven Antrun plugin to copy the file.
However, the latter part does not make much sense. If it is a configuration file to put in a server, simply manually copy it.
No plugin definitions needed, just edit the build resources:
Reference:
process-resources
(Maven Book)<build><resources>
(POM Reference)