Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Including only specific OS libs in boot jar

27 views
Skip to first unread message

Abhishek Yadav

unread,
May 5, 2023, 11:20:51 AM5/5/23
to javacpp
Hello There,

I am using platformcv to stream from rtps stream and do further processing using javacv. 
Currently bootjar is containing libs for all OS including windows/mac/linux which is making size of the jar file huge. I am looking for a way to keep libs only for specific OS. Can you please suggest how can I achieve that.
below is content of gradle here for reference:

plugins {
id "org.springframework.boot" version "3.0.4"
id 'java'
id 'org.bytedeco.gradle-javacpp-platform' version "1.5.8"
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}
ext {
javacppPlatform = 'macosx-arm64' // or any other platform, defaults to Loader.getPlatform()
}

tasks.jar {
enabled = false
archiveClassifier.set("")
}

bootJar {
archiveBaseName = "video_streaming_poc"
archiveVersion = "1.0.0"
}

dependencies {

// https://mvnrepository.com/artifact/org.bytedeco/javacv
implementation group: 'org.bytedeco', name: 'javacv-platform', version: '1.5.8'


}



Samuel Audet

unread,
May 6, 2023, 9:53:45 AM5/6/23
to javacpp
If you're using Gradle, setting the javacppPlatform property like you're doing will do what you want. Could you maybe rephrase your question?

--
You received this message because you are subscribed to the Google Groups "javacpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacpp-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/javacpp-project/9eecd4bb-bc29-4d8a-943a-e43be283acd9n%40googlegroups.com.

Abhishek Yadav

unread,
May 6, 2023, 9:02:36 PM5/6/23
to javacpp...@googlegroups.com
Hello Samuel,

Thanks for your email, yes the gradle setting I took from your git page itself. If you noticed, I am only specifying macosx-arm64 as javacppplatform but still it’s downloading all dependencies for other os as well, and when I am building bootjar, its containing these additional dependencies of other os which is contributing in its size.

Ideally it should download only macos related libs which is not happening. I am using ffmpeg libs to convert rtsp streams to file.



Samuel Audet

unread,
May 6, 2023, 10:13:07 PM5/6/23
to javacpp...@googlegroups.com, Abhishek Yadav
Maybe there's a conflict with the plugin for Spring Boot. Could you try
without Spring Boot see if it does the same thing or not?
Reply all
Reply to author
Forward
0 new messages