terl / lazysodium-java

A Java implementation of the Libsodium crypto library. For the lazy dev.
https://github.com/terl/lazysodium-java/wiki
Mozilla Public License 2.0
135 stars 47 forks source link

Missing resource-loader dependency #71

Closed dmitry-timofeev closed 4 years ago

dmitry-timofeev commented 4 years ago

resource-loader is neither specified as a project dependency so that it can be fetched by the build system, nor is bundled in the lazysodium-java distribution, leading to a runtime error:

java.lang.NoClassDefFoundError: co/libly/resourceloader/SharedLibraryLoader

Version: 4.2.5

Workaround

It is possible to overcome the problem by specifying an explicit dependency on resource-loader. However, that might eventually result in an incompatible combination of lazysodium and resource-loader versions in the user projects.

gurpreet- commented 4 years ago

You are correct. This is becoming a pain in some of my other projects too.

I had initially encouraged users to add resource-loader from its bintray repository this but enterprise preferred maven central. This is due to them having to add yet another maven repository which for some enterprise companies means more exceptions which means more rigamarole. However, maven central is slow to update which is causing a lot of pain for me as a consumer of my own library

You might be seeing your error because resource loader is loaded as a JAR rather than a gradle dependency in 4.2.5. I had tested this on an empty Java project and it worked, not sure why it isn't for you 🤔

gurpreet- commented 4 years ago

Try release 4.2.6. I think I fixed it.

dmitry-timofeev commented 4 years ago

It works, thank you a lot!

Yes, Maven Central takes quite some time to make the artifacts available :-)

I had tested this on an empty Java project and it worked, not sure why it isn't for you 🤔

Can't say definitely, but it might have been installed locally in your ~/.m2/repository.

gurpreet- commented 4 years ago

Thanks for your help once again! 🙂