1

I need to copy the content of the example folder under : src/main/resources/example to the root of the generated jar file by maven

The problem seems to be with spring-boot-maven-plugin which generates this under BOOT-INF folder inside the jar.

<resources>
    <resource>
        <targetPath>example</targetPath>                           
        <directory>${basedir}/src/main/resource/example</directory>
    </resource>
</resource>

I expect the content under the example folder to be compiled to jar's root Actual: Actual behavior

peterh
  • 18,404
  • 12
  • 87
  • 115

2 Answers2

0

Please remove any spring-boot plugin and only use resources tag as explained in the comment.

<resources>
 <resource>
   <targetPath>Where_you want_loc</targetPath>
</resource></resources>
Chinmoy
  • 1,391
  • 13
  • 14
-1

Instead of copy the folder to the JAR, why you don't acess the folder there where it is?

Java: Acess and read all files in a folder

I hope this help you...