influxdata / influxdb-client-java

InfluxDB 2 JVM Based Clients
https://influxdata.github.io/influxdb-client-java/
MIT License
440 stars 129 forks source link

Cross published artifacts? #210

Closed harpocrates closed 3 years ago

harpocrates commented 3 years ago

The artifacts published to Maven are not cross-published. Artifacts appear to be built with Scala 2.13.2, but no JARS are published with the _2.13 suffix. Here's a quick visual way to spot this on Maven: notice how the shapeless library has a column for "Scala" but influxdb-client-scala doesn't.

Steps to reproduce: Try to use influxdb-client-scala inside any Scala project built using Scala 2.12. For instance, using the Ammonite REPL for 2.12:

$ amm
Loading...
Welcome to the Ammonite Repl 1.1.2
(Scala 2.12.6 Java 1.8.0_144)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
@ import $ivy.`com.influxdb:influxdb-client-scala:2.0.0`
java.io.IOException: Scala signature package has wrong version
 expected: 5.0
 found: 5.2 in package.class
...

Expected behavior: The project fails to compile since influxdb-client-scala is not published for Scala 2.12, or successful compilation using a Scala 2.13 artifact.

Actual behavior: The project crashes at runtime due to a mismatch in scala-library versions

error while loading package, class file '/Users/atheriault/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/collection/mutable/package.class)' is broken
(class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature package has wrong version
 expected: 5.0
 found: 5.2 in package.class)
Compilation Failed

Specifications:

bednar commented 3 years ago

Hi @harpocrates,

thanks for using our client, We will take a look.

Regards

bednar commented 3 years ago

Hi @harpocrates,

the issue is fixed in 2.2.0 milestone. You could use a preview version by:

<dependency>
  <groupId>com.influxdb</groupId>
  <artifactId>influxdb-client-scala_2.12</artifactId>
  <version>2.2.0-SNAPSHOT</version>
</dependency>

Regards