从war文件中取出所有不必要的jar [英] Excude all the unnecessary jar from war file

查看:226
本文介绍了从war文件中取出所有不必要的jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是grails程序员,我想删除war文件中包含的不必要的jar文件。 war文件中包含了许多不必要的jar文件。有没有快速的解决方案呢?你也可以提一下制作和运行简单的grails战所需的jar文件。

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.

推荐答案

你可以从中排除不必要的jar通过在BuildConfig.groovy中添加以下行来进行战争。

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")
}

示例:删除hibernate核心

Example : Removing hibernate core

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

这篇关于从war文件中取出所有不必要的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆