How To Make a Folder Appear When Unzipping Jar Fil

2019-08-21 10:35发布

问题:

Hi I am fairly new to Spring boot and Gradle. My question is how do I get a folder that I currently have in my Spring boot project to appear when I open up the jar file?

  • I have a folder with bash scripts in my spring boot project called: bashScriptFolder

  • its directory structure is src/main/bashScriptFolder

whenever I deploy my jar file into a linux server and open up the jar file the bashScriptFolder does not appear. Im assuming I have to make a gradle task for this to happen but Im not sure how to do that. Ive been trying to look at different stackover flow pages for this problem but I cant find 1 quite clear post to do this maybe im not wording my search right. I would really appreciate the help guys.

Thank you

回答1:

Put bashScriptFolder inside src/main/resources and jar task will add it by default. Or use from - include in jar task configuration, e.g. like here: Add resources, config files to your jar using gradle