Cristian Cristian - 11 months ago 58
Java Question

Copy file to jar root when building spring-boot project with Maven

I have a Spring Boot project and I'm building the jar file with mvn clean build.
I need to copy a folder and a file to the root of the jar, where META-INF is located. I tried maven-resources-plugin but I can't reach my goal.

For war files I used maven-war-plugin in the past but I can't find something similar for jars.

Can anybody give me an idea?


Answer Source

I resolved my problem by using the maven-assembly-plugin. I created an assembly zip which contains the application jar and some other resources. This solution is specific for applications which use AWS Elastic Beanstalk and need to implement the Procfile (

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download