NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
344 stars 143 forks source link

Deadlock because of old jna dependency #187

Open hborchardt opened 4 years ago

hborchardt commented 4 years ago

I have a project that depends on nrjavaserial as well as jna. Upon adding the jna 4.4.0 dependency, when searching for serial ports I irregularly run into the deadlock resolved here: jna commit 869bb33984a2cf701f9343ea40cca27ffec4be88, which is merged in jna 5.0.0.

Therefore, I propose updating the dependency on jna to the newest one, 5.5.0.

Additionally, it came to my attention that the jna dependency is defined in build.gradle as a compileOnly-dependency. This means that any version requirements on jna don't make it to the mvnrepository. It would be much better to declare this as an optional dependency, per this blog post. Then, I suppose, it would be enforced that it is not possible to have jna 4.4.0 as well as nrjavaserial in the same project, avoiding the bug.