Is it possible prevent copying of resources to build directory in Gradle project and directly use them from original location?

匆匆过客 提交于 2020-07-22 11:11:20

问题


I come from Grails background and there was a feature where our changes to CSS, HTML & JS files were instant and didn't needed rebuilding code again.

Now, while building a Micronaut project I would like to have something similar but I am unable to figure how to configure Gradle for same.

Till now, I found out if I make changes to copied resources inside build folder, changes are reflected on browser and don't require rebuilding code but this forces me to do changes to original file later.

Can I somehow make Gradle directly use src/main/resources from it's original location rather than Gradle copying it to build folder?


回答1:


You might be looking for ./gradlew run --continuous but depending on what things you are changing in the resources/ folder, those changes may nor may not affect the running app without restart.

More information is available at https://docs.micronaut.io/1.1.2/guide/index.html#reloading.

I hope that helps.



来源:https://stackoverflow.com/questions/56443203/is-it-possible-prevent-copying-of-resources-to-build-directory-in-gradle-project

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