Excude all the unnecessary jar from war file

点点圈 提交于 2019-12-12 18:37:14

问题


I am a grails programmer and I want to remove the unnecessary jar files that are included in the war file. There are so many unnecessary jar files included in the war file. Is there any quick solution to do so? Also can you mention the jar files which are necessary to make and run the simple grails war.


回答1:


You can exclude unnecessary jar from war by adding following lines in BuildConfig.groovy.

grails.war.resources = { stagingDir ->
  delete(file:"${stagingDir}/WEB-INF/lib/jarFileName.jar")
}

Example : Removing hibernate core

grails.war.resources = { stagingDir ->
  delete(file:"${stagingDir}/WEB-INF/lib/hibernate-core-3.3.1.GA.jar")
}


来源:https://stackoverflow.com/questions/24830223/excude-all-the-unnecessary-jar-from-war-file

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