Excude all the unnecessary jar from war file

2019-07-16 03:37发布

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条回答
乱世女痞
2楼-- · 2019-07-16 04:39

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")
}
查看更多
登录 后发表回答