1

In our Pipeline I have a surprising situation. If I using Gradle 6.8.x and higher a COPY *.jar to /opt/file.jar inside an unchanged Dockerfile did not work with:

Step 21/33 : COPY *.jar /opt/file.jar When using COPY with more than one source file, the destination must be a directory and end with a /

Using Gradle with version 6.5.x and early it works.

Which different behavore has Gradle with 6.8.x and higher, which ends in conflicts with a Dockerfile and how can I solve this?

Thx in advance

Volker
  • 11
  • 2

1 Answers1

0

Not sure if this helps, but I had the same problem (updating from Gradle 6.5 to 7.3), and also simultaneously updating from Spring Boot 2.4 to 2.6, which was actually my problem.

Spring Boot starts to create plain.jar by default next to your jar (documentation) since version 2.5.0, so in my build folder were actually 2 *.jar files and the COPY error was correct.

How to disable creation of plain.jar file is answered here

If this is not your case, please check what actually gets created in your build folder and if there are multiple files.

bombic
  • 1
  • 2