Java最小化依赖关系 [英] Java Minimize Dependencies

查看:159
本文介绍了Java最小化依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,那里有一小块Java代码,它有大量的jar依赖它。然而,这些罐子之间的依赖非常浅。在大多数情况下,它只取决于单个界面的jar。



我不想将所有的jar分发到应用程序,而是要分发特定的类文件在它实际使用的罐子里面。这样做的原因是为了节省空间(此代码将生活在一个小程序中)。



有人知道自动执行此工具或方法吗?假设所有的依赖项是静态的,这似乎完全是可能的。任何想法?

解决方案

Classdepandjar 将剥离代码库到基本类。它在Jini世界中用于提供最佳大小的jar,但没有任何Jini特定的。



可用作Ant任务。


I have a situation where there is a small piece of Java code that has a large number of jars that it depends on. However, the dependencies inside these jars are very shallow. In most cases it only depends on a jar for a single interface.

Instead of distributing all of the jars with the application, I would like to just distribute the specific class files inside the jars that it actually uses. The reason for this is to conserve space (this code will live in an applet).

Does anyone know of a tool or method to do this automatically? Assuming all of the dependencies are static, this seems entirely possible. Any ideas?

解决方案

Classdepandjar will strip down a codebase to the essential classes. It's used in the Jini world for delivering optimally-sized jars, but there's nothing Jini-specific about it.

Available as an Ant task.

这篇关于Java最小化依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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