0

I am seeing some weird behavior after running "mvn clean install" to build my Spring Boot app. Whenever I put a PDF document in my "static" folder or any other folder serving files into my app, the compiled version of the PDF files are all blank. These compiled versions are found in the target/classes/static folder, along with all my other static images, js, css which is just fine. I'm running my localdev environment on MacOS Mojave 10.14.1, Apache Maven 3.6.0 installed via Homebrew, and Spring Boot 2.1.1.

Any ideas or suggestions? I tried multiple PDF files including some local ones and some internet downloads, so I think it's happening to all of them in general.

Initial Commit
  • 497
  • 3
  • 14
  • 1
    What do you mean by "blank"? Is the file size 0? Or you see a blank PDF document when you open it? Maven won't erase the content of a PDF document. – khachik Apr 01 '19 at 02:11
  • No the compiled file size is actually larger than the original file size. The original file was about 1.3 MB and the output version in the target folder is 2.1 MB. There are the same number of pages in the output files as the originals, but they are all white, empty, blank pages with no content. – Initial Commit Apr 01 '19 at 03:12

1 Answers1

1

Figured this out - it was due to the resource settings in my pom.xml. See existing post:

PDF file with empty pages appearing after Copying using Java Files.copy

Solution was to add the following into my filters:

<exclude>**/*.pdf</exclude>
<include>**/*.pdf</include>
Initial Commit
  • 497
  • 3
  • 14