How To Make a Folder Appear When Unzipping Jar File Using Gradle?

故事扮演 提交于 2020-01-06 05:23:37

问题


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



来源:https://stackoverflow.com/questions/54391511/how-to-make-a-folder-appear-when-unzipping-jar-file-using-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!