barnhill / barcode-java

Java Barcode Image Generation Library
MIT License
25 stars 14 forks source link

Lib can't be pulled from Maven since 2.2 #26

Open zzrough opened 3 months ago

zzrough commented 3 months ago

hello,

Thanks for the library, I'm using it from quite a long time and it works nice!

I was using the 1.x branch and wanted to switch to the latest (2.6.1) but I see the artifacts are hosed since 2.2. I get the error: The following artifacts could not be resolved: com.pnuema.java:barcode:jar:2.6.1 (absent) when using the dependency example shown in the README.

If I check on mvnrepository, it's ok in 2.1: image image

But in 2.2, it's not published the same we see a -jar.jar: image image

I see a commit mentioning a classifier change which is certainly the -jar is all about. I did not add the dependency in a fancy way but it does not see to work anymore from 2.2 onwards.

best regards, --Stef

zzrough commented 3 months ago

(I had to add jar in the dependency node, but it's the only lib I need to do this, I wonder why)

barnhill commented 3 months ago

What the ... Why is it tacking on a funky name. I'll look at this

barnhill commented 3 months ago

Just published 2.6.2 that should have the archive name corrected. It takes some time to sync with maven central then Ive got my personal project that uses it and Ill try to pull it in there to make sure the dependency resolution works correctly.

barnhill commented 3 months ago

Looks like its already available. I just built my project and pulled that in successfully. Let me know if this works for you to switch to version 2.6.2

Screenshot 2024-04-07 at 10 48 39 AM

zzrough commented 3 months ago

hey I answered just after your comment from email but I see my reply was not sent over github or it does not work anymore to reply by email?

it works great! so fast to fix it!
thanks a lot!
--Stef

But, when running in UAT I spot we had many new librairies:

*** kotlin-android-extensions-1.9.22.jar ***
*** kotlin-build-tools-api-1.9.22.jar ***
*** kotlin-compiler-embeddable-1.9.22.jar ***
*** kotlin-compiler-runner-1.9.22.jar ***
*** kotlin-daemon-client-1.9.22.jar ***
*** kotlin-daemon-embeddable-1.9.22.jar ***
*** kotlin-gradle-plugin-1.9.22.jar ***
*** kotlin-gradle-plugin-annotations-1.9.22.jar ***
*** kotlin-gradle-plugin-api-1.9.22.jar ***
*** kotlin-gradle-plugin-idea-1.9.22.jar ***
*** kotlin-gradle-plugin-idea-proto-1.9.22.jar ***
*** kotlin-gradle-plugin-model-1.9.22.jar ***
*** kotlin-klib-commonizer-api-1.9.22.jar ***
*** kotlin-native-utils-1.9.22.jar ***
*** kotlin-project-model-1.9.22.jar ***
*** kotlin-scripting-common-1.9.22.jar ***
*** kotlin-scripting-compiler-embeddable-1.9.22.jar ***
*** kotlin-scripting-compiler-impl-embeddable-1.9.22.jar ***
*** kotlin-scripting-jvm-1.9.22.jar ***
*** kotlin-stdlib-1.9.22.jar ***
*** kotlin-tooling-core-1.9.22.jar ***
*** kotlin-util-io-1.9.22.jar ***
*** kotlin-util-klib-1.9.22.jar ***
*** kotlinx-coroutines-core-jvm-1.7.3.jar ***

I see the project brings kotlin-stdlib in compile scope but I don't see any use in the source code? The rest is runtime but pulled of transitively so the barcode project adds many libraries.

--Stef

barnhill commented 3 months ago

Probably this line in the Gradle config

https://github.com/barnhill/barcode-java/blob/master/build.gradle.kts#L24

barnhill commented 3 months ago

This project does use dokka for javadoc generation and that uses kotlin but the actual project doesnt.

Even removing this doesnt change the size of the jar.

Screenshot 2024-04-11 at 10 59 27 PM
barnhill commented 3 months ago

I did remove those and published 2.6.3 tonight to see if that helps you all. Please let me know if removing those dependencies in this commit helped.

https://github.com/barnhill/barcode-java/compare/2.6.2...2.6.3

zzrough commented 3 months ago

thanks, I tested with 2.6.3 the change is very different, my app total distribution size:

I see indeed the dokka deps pulling deps a bit: image

I received the following extra transitive deps:

I did not practice Gradle for a long time, but it seems to me this should be a plugin (in plugins section), not a project dependency (in dependency section)? https://kotlin.github.io/dokka/1.4.0/user_guide/gradle/usage/

barnhill commented 3 months ago

But I see it's way down from the previous.

zzrough commented 3 months ago

yes it's better but still brings a couple of libs from dokka... I'll ignore them in my project for the time being :+1: thanks for your help