在java中有静态jar链接这样的东西吗? [英] Is there such a thing as static jar linking in java?

查看:285
本文介绍了在java中有静态jar链接这样的东西吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java中是否存在静态jar链接?

Is there static jar linking in java?

我看到的方式是对jar的静态链接从jar中提取相关的类文件并将其插入到最终产品罐。当然,它应该将库jar中的任何相关许可文件复制到产品罐中。

The way I see it is that static linking against a jar extracts the relevant class files from the jar and inserts them into the final product jar. Of course, it should copy any relevant license files from the library jar into the product jar.

动机。

我想使用ant.jar中的 ExpandProperties 类。该功能本身可能只占1.8M的一小部分,这是ant.jar的大小。

I would like to use the ExpandProperties class from ant.jar. The feature itself is likely to occupy just a fraction of the 1.8M, which is the size of ant.jar.

推荐答案

Maven可以使用程序集插件执行此操作,但如果涉及开源库,通常会遇到许可问题。

Maven can do that with the assembly plugin, but you usually run into licensing issues if there are open source libraries involved.

这篇关于在java中有静态jar链接这样的东西吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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