简体   繁体   English

排除依赖罐中的特定类-GRADLE

[英]Excluding specific classes within a dependent jar - GRADLE

I have a jar file : sp-common-types.jar which is provided by a different team. 我有一个jar文件:sp-common-types.jar,由另一个团队提供。 This has around 6 classes. 这大约有6节课。 I do not want to include 2 classes out of these. 我不想在其中包括2个班级。 I am able to exclude the jar using the statement below in gradle. 我可以使用gradle中的以下语句排除jar。 If I want to exclude specific classes from the jar , how can it be achieved. 如果我想从jar中排除特定的类,如何实现。

compile("com.xyz.sp:sp-boot:0.1.1"){ exclude group: "com.xyz.sp", module: 'sp-common-types' } compile(“ com.xyz.sp:sp-boot:0.1.1”){排除组:“ com.xyz.sp”,模块:'sp-common-types'}

I don't believe it is possible to exclude files/classes at dependency import time. 我不认为有可能在依赖项导入时排除文件/类。 The only solution I can think of that might work , but would be a gross solution, would be to write a task that manually goes and deletes the folder structures that you don't want from the jar you imported. 我能想到的唯一解决方案可能可行 ,但总的解决方案是编写一个手动执行的任务,并从导入的jar中删除不需要的文件夹结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM