Closed yatw closed 4 years ago
Hi @yatw,
The reason why your install fails is because Lazysodium recently packaged the loading of shared libraries into it's own library called resource-loader
, simply due to the fact that it was very difficult to extract things out from JARs. The reason this error occurs is because Resource Loader is only available on jCenter
, whereas Lazysodium is available on its own repository (https://dl.bintray.com/terl/lazysodium-maven
) as well as jCenter
.
So in order to solve this, the recommended way now is to use jCenter
rather than https://dl.bintray.com/terl/lazysodium-maven
. I am not sure how to specify the main jCenter
repository in Maven. But once you have it specified, then you can just theoretically just add the following to your pom.xml:
<dependencies>
<dependency>
<groupId>com.goterl.lazycode</groupId>
<artifactId>lazysodium-java</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.5.0</version>
</dependency>
</dependencies>
I have now updated the installation pages in the docs to reflect this.
Thank you for explaining the problem. After setting up the repository to jCenter in maven, I was able to install the library and run SodiumJava sodium = new SodiumJava();
Below is the code used to set up the repository to jCenter in maven.
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
Please consider update the documentation to helper other beginners set up the library. Thanks again.
I had to add: implementation 'co.libly:resource-loader:1.3.7' and then it worked.
For my pom.xml
I only needed to add the jcenter
repository as shown above, and then I add the lazy-sodium
and jna
dependencies as shown above. But no need to add in pom.xml
the resource-loader
. I later, checked that resource-loader
got automatically downloaded as a transitive dependency of lazy-sodium
. Of most curious, is that even if I only add lazy-sodium
as a dependency it automatically downloads both jna
and resource-loader
into .m2/
local repo folder. But the app won't run, I then have to add into pom.xml
the jna
for the app to run.
Please update the documentation. I followed the how to install Lazysodium and was unable to install
Hi, I am getting the
Could not find artifact co.libly:resource-loader:pom:1.3.5 in lazysodium-java (https://dl.bintray.com/terl/lazysodium-maven)
error when compiling the pom.xmlHere is my maven pom.xml following the instruction from https://docs.lazycode.co/lazysodium/usage/installation
I also tried to install library using the gradle instruction; gradle works fine. Must be a maven problem then.