paw是什么意思| 胆木是什么| 上报是什么意思| md是什么意思| 梦见考试是什么意思| 什么叫变态| 心脏早博吃什么药好| 桂圆补什么| 什么植物最老实| 看颈椎挂什么科| 火险痣是什么意思| fion属于什么档次的包| 白细胞低有什么危害| 经常生气会得什么病| 耳朵烫是什么预兆| 怀孕两个星期有什么反应| 黑胡椒和白胡椒有什么区别| 牙刷什么样的刷毛最好| d二聚体是什么| 低血糖不能吃什么食物| 网黄是什么意思| 上火吃什么食物| ca代表什么病| 阑珊处是什么意思| 邂逅什么意思| 眉茶属于什么茶| 二月二十一是什么星座| 尿频尿不尽吃什么药| 人体最大的器官是什么| 书五行属什么| 子宫肌瘤是什么原因造成的| 那敢情好是什么意思| hi是什么| 旅长是什么级别| 肺气肿是什么病| 茯苓是什么味道| 吃什么食物能提高免疫力| 肠胃炎可以吃什么药| 五黄煞是什么意思| 花生属于什么类| 悲戚是什么意思| 发烧吃什么食物| 火龙果什么时候成熟| 红枣有什么功效和作用| 早上吃什么减肥| 梦见吐血是什么预兆| 过敏是什么症状| 早上吃什么水果最好| 烹饪是什么意思| 偏光太阳镜是什么意思| 与什么俱什么| 新生儿痤疮是什么引起的| 小丑什么意思| 夏天喝什么汤| 舌苔发黄是什么原因引起的| 结核是什么病| 轻微食物中毒吃什么药| 来月经同房会有什么后果| 金牛座女和什么星座最配| 含量是什么意思| 马驹是什么意思| 5月17日是什么星座| 怀孕吃什么水果比较好| 泌尿外科是看什么的| 无机盐包括什么| 让我爱你然后把我抛弃是什么歌| 医院属于什么性质的单位| 颈椎反弓是什么意思| 今天什么日子老黄历| 石花膏是什么做的| 成龙姓什么| 甲亢不能吃什么东西| 做梦梦见剪头发是什么意思| 什么动物吃蜘蛛| 人流后吃什么最补子宫| 晏字五行属什么的| 综合内科是看什么病| 日逼是什么意思| 阴差阳错代表什么生肖| 肺结节吃什么药散结节最快| 吃月饼是什么节日| 上善若水下一句是什么| 心脑血管疾病吃什么药| 去台湾需要什么证件| tm什么意思| 减肥去医院挂什么科| 蝙蝠来家里是什么预兆| 周公解梦是什么意思| 玉树临风什么意思| 一月九号是什么星座| 骨赘形成是什么意思| 水肿是什么原因| 天蝎座跟什么星座最配| 女生的逼长什么样| 饭中吃药是什么时候吃| 灯笼裤配什么鞋子好看| 脾虚吃什么食物补最快| 大雄宝殿是什么意思| 脚底脱皮用什么药膏| 膝盖疼痛吃什么药| beside是什么意思| mds医学上是什么意思| 一个鱼一个完读什么| 血压低什么原因造成的| 苏州五行属什么| 婴儿有眼屎是什么原因引起的| 人为什么要生孩子| 宁静致远是什么意思| 什么的什么是什么的伞| 万兽之王是什么动物| 上海有什么玩的| 卡介苗为什么会留疤| ips屏幕是什么意思| 资本运作是什么意思| 六害是什么意思| 潘驴邓小闲是什么意思| 什么药可以通血管| 轶事是什么意思| 为什么鸡蛋不能和牛奶一起吃| 宝宝拉肚子能吃什么| 豆浆和什么搭配最好| dm是什么意思| 刀伤用什么药愈合最快| 烧火棍是什么意思| 梅毒会通过什么传染| 三价铁离子什么颜色| 271是什么意思| 大熊猫属于什么科| cmn是什么意思| 福鼎白茶属于什么茶| 吃什么调节内分泌最快| plover是什么牌子| 俄罗斯是什么人种| 泥鳅喜欢吃什么食物| 慢性荨麻疹是什么症状| 离婚要什么手续| 去离子水是什么水| 扁豆长什么样子图片| 胸部胀痛是什么原因| 什么叫桑拿| flag是什么意思| 大专什么专业就业前景好| quest是什么车| 牛筋面是用什么做的| 春节为什么要放鞭炮| crocs是什么牌子| 处女座跟什么星座最配| 蜈蚣代表什么生肖| 女人出黄汗是什么原因| 县检察长是什么级别| 嬲是什么意思| 为什么老虎头上有王字| 榴莲为什么这么贵| 首重是什么意思| 腿上有淤青是什么原因| 玛卡是什么| 南京市市长什么级别| 强化是什么意思| 外阴瘙痒什么原因| 膝盖咔咔响是什么原因| 岁月静好什么意思| 七月八号是什么日子| ysl是什么意思| 如花是什么意思| 血小板低是什么引起的| ss是什么意思| 正三角形是什么| 女人性冷淡吃什么药| 妇科清洁度3度用什么药治疗| 雨对什么字| nt是什么意思| 日照香炉生紫烟是什么意思| 用什么消肿最快最有效方法| 鬓角长痘痘是什么原因| 唐筛是检查什么的| 地球里面是什么| 4月26日是什么星座| 梦见自己吐了是什么意思| 2024年是什么命| 膀胱炎什么症状| 一什么孩子| saucony是什么牌子| 狗癣用什么药最有效| mickey是什么牌子| 打嗝医学术语是什么| 钾在人体中起什么作用| 吃杨梅有什么好处| 三什么一什么四字词语| 痘痘挤出来的白色东西是什么| 无创低风险是什么意思| 什么情况下血压会升高| 支气管哮喘吃什么药| 晶体是什么| 飞沙走石是什么意思| 上环后同房要注意什么| 来事吃什么水果好| 假释是什么意思| 寅五行属什么| 肺部有阴影是什么原因| 鸡肉煲汤加搭配什么好| 脱氢酶高是什么原因| 为什么牙齿会发黑| attach什么意思| 龟头瘙痒是什么原因| 推拿和按摩有什么区别| 山今读什么| 空你几哇什么意思| 蜻蜓点水是什么行为| 米参念什么| 猥琐男是什么意思| fdp是什么意思| 相合是什么意思| 包二奶什么意思| 一个月来两次月经是什么原因| bioisland是什么牌子| 为什么会便血| oppo最新款是什么型号| 冬枣不能和什么一起吃| 蛞蝓是什么动物| 腺肌症是什么原因引起的| 什么叫做靶向治疗| 喰种是什么意思| 青花鱼是什么鱼| 什么时候打胎对身体伤害最小| 自食其力是什么意思| c3是什么车型| 复制是什么意思| wh是什么颜色| 亦女念什么| ojbk什么意思| 今年40岁属什么生肖| 负压引流器有什么作用| 补气血吃什么水果| 猪蹄炖什么| 区武装部部长是什么级别| 什么是宫缩| 三伏贴能治什么病| 手指甲上的月牙代表什么| 神的国和神的义指的是什么| 筋道是什么意思| 预谋什么意思| 庸俗是什么意思| 肌张力是什么意思| 血压和血糖有什么关系| 汗斑用什么药膏好| 月亮什么时候是圆的| 一眼万年是什么意思| 鸡胸是什么病| 记忆力减退是什么原因造成的| 什么动物不长胡须| 日本浪人是什么意思| 吃饭后胃胀是什么原因| 黄芪和枸杞泡水喝有什么作用| 虐恋是什么意思啊| 文武双全是什么意思| 肾气不足吃什么药| 芡实适合什么人吃| 长期喝蜂蜜水有什么好处| 木棉花的花语是什么| 绿豆和什么不能一起吃| 心悸是什么| 大圣是什么生肖| 张属于五行属什么| 前胸后背长痘痘用什么药| 百度
Skip to content

Reducing the Number of Dependencies

Samuel Audet edited this page Mar 18, 2022 · 7 revisions

Introduction

Native binaries are inherently large in size, and we need to use a different set of libraries for each supported platform. However, if your application does not depend on all these libraries or does not need to support all these platforms, there are a few ways to reduce easily the number of dependencies, apart from manually excluding artifacts one by one or removing files from uber JARs.

Include binaries only for one or more platforms

For applications depending on artifacts with names ending with -platform, to limit dependencies to a single platform, set the javacpp.platform system property of Maven to the desired platform, for example:

mvn -Djavacpp.platform=linux-x86_64 ...

To include binaries for 2 or more platforms, we can rely on a different set of profiles, but always starting by setting the javacpp.platform.custom system property to reset the default one from javacpp.platform. For example, in the case of the host platform, plus Mac and Windows, we can use commands starting with:

mvn -Djavacpp.platform.custom -Djavacpp.platform.host -Djavacpp.platform.macosx-x86_64 -Djavacpp.platform.windows-x86_64 ...

Note: This works only with Maven. It does not work with Gradle, sbt, or any other build system, but we can do something similar to that using Gradle JavaCPP, SBT-JavaCPP, or SBT-JavaCV.

Including binaries only for mobile platforms

Mobile platforms (Android and iOS) typically rely on Gradle for their build systems, so the trick mentioned above does not work. Although we can use Gradle JavaCPP, since the artifacts that are useful to a given mobile application are determined at build time, we can also directly specify only the desired artifacts in the build file--without relying on any -platform artifacts. For example, to include only binaries useful for FFmpeg on android-arm64 and android-x86_64 platforms, we can use entries such as the following inside the dependencies { } block of the app/build.gradle file:

implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.7'
implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.7', classifier: 'android-arm64'
implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.7', classifier: 'android-x86_64'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '5.0-1.5.7'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '5.0-1.5.7', classifier: 'android-arm64'
implementation group: 'org.bytedeco', name: 'ffmpeg', version: '5.0-1.5.7', classifier: 'android-x86_64'

Excluding all binaries via -platform artifacts

On the other hand, to remove all dependencies related to a given library for all platforms, the mechanisms already in place for the pom.xml file are most efficient. For example, if the application uses JavaCV but without anything related to OpenCV, we can add a dependency such as the following to avoid all of its large artifacts:

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacv-platform</artifactId>
        <version>1.5.7</version>
        <exclusions>
            <exclusion>
                <groupId>org.bytedeco</groupId>
                <artifactId>opencv-platform</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Note: This works the same with similar features in Gradle, sbt, and other build systems. We can use this method, and then re-add only the desired artifacts in the way mentioned above in the previous section.


For additional assistance, please feel free to post your questions on the mailing list or open new issues on GitHub.

Clone this wiki locally
空调漏水是什么原因 脸麻是什么原因引起的 秋葵炒什么好吃 木槿是什么意思 闺蜜是什么意思
头发斑秃是什么原因引起的 眼带用什么方法消除 吃什么可以补精子 稷字五行属什么 521是什么星座
病是什么结构的字 刑警队是干什么的 杠是什么意思 梦见别人送钱给我是什么意思 睡眠不好是什么原因
什么是低血糖 ab型rh阳性是什么意思 臭屁多是什么原因 为什么会流鼻血 唇炎应该挂什么科室
乔迁送什么礼物好hcv7jop9ns1r.cn 坐月子什么不可以吃hcv7jop6ns3r.cn 梦见死人的场面是什么兆头hcv7jop6ns5r.cn 江苏有什么特产hcv7jop9ns2r.cn 肾气亏虚吃什么中成药helloaicloud.com
哺乳期吃什么下奶hcv8jop7ns7r.cn 结婚五周年是什么婚hcv9jop4ns9r.cn 99新是什么意思bysq.com 属猴的和什么属相最配hcv8jop1ns9r.cn 尿常规隐血弱阳性什么意思hcv7jop9ns8r.cn
尿痛吃什么药效果最好hcv8jop2ns7r.cn 鲁班是什么家sscsqa.com 冬虫夏草有什么功效与作用hcv7jop4ns7r.cn 心悸是什么感觉hcv9jop2ns6r.cn 怀孕皮肤变差什么原因hcv8jop3ns5r.cn
治疗神经痛用什么药最有效hcv9jop3ns6r.cn 肌红蛋白偏低什么原因hkuteam.com 物以类聚是什么意思hcv7jop4ns8r.cn 功课是什么意思hcv9jop4ns3r.cn 虾跟什么不能一起吃hcv9jop3ns2r.cn
百度