Gradle Shadow:如何包括一些包裹

发布于 2025-02-03 09:46:40 字数 441 浏览 4 评论 0原文

我有这个依赖性,我想在罐子中包括在内而不将其最小化。

但这将排除一些重要的类。 因此,我尝试使用依赖性。

但这将包括所有类。

如何将自定义过滤器与代码一起使用?

或在罐子中包括特殊依赖项。

I have this dependency, I want to include this in the jar without minimizing it.
enter image description here

But that will exclude some important classes.
So I tried to use include dependency.
enter image description here

But that will include all the classes.

How can I use the custom filter with code?

Or include special packages of dependency in the jar.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难以启齿的温柔 2025-02-10 09:46:40

没有默认选项可以包括JAR(依赖项)中的部分类。

您拥有的两个选项是

  1. ,如果这是一个“很少”更改的类
    用所需的类手动创建一个自定义罐子

  2. 中使用它,如果这是“经常”更改的类
    在JAR和课后之前创建一个任务,以将需要的类提取到build /../类文件夹

there are no default options to include partial set of classes from a jar (dependency).

The 2 options you have are

  1. if this is a 'rarely' changing set of classes
    manually create a custom jar with the classes you need, save it local to project or in nexus and use it in the include

  2. if this is a 'often' changing set of classes
    create a task, before jar and after classes, to extract the classes you need in to the build/../classes folder

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文