confluentinc/rest-utils

Java 11 dependency resolution failure on artifact "javafx.base"

seglo opened this issue · 3 comments

seglo commented

Hi. I recently upgraded to Confluent Platform 5.4.0 and pull in kafka-avro-serializer (which has a dependency on rest-utils), and I noticed that our Java 11 builds were failing with a dependency resolution failure:

[error] (tests / update) sbt.librarymanagement.ResolveException: Error downloading org.openjfx:javafx.base:11.0.0-SNAPSHOT

We were able to track this down to a dependency rest-utils declares here

<jersey.version>2.28</jersey.version>

The artifact org.glassfish.jersey.ext:jersey-bean-validation:jar:2.28 brings in a version of hibernate-validator that references the non-published javafx.base artifact.

The issue is described in more detail in this upstream hibernate ticket, and why it's only applicable in Java 11 builds. There's a StackOverflow post that discusses the problem as well. I think upgrading your jersey version may address the issue, but in the meantime I've added an exclusion rule for javafx.base.

Interesting, it seems to resolve ok with a stock install of jdk11 + maven from oss.sonatype.org in a snapshots repository. Since it looks like you're probably using sbt for your project I guess the default sets of repos don't match between this project and yours.

seglo commented

Thanks for the hint, @ewencp. The org.openjfx:javafx.base:11.0.0-SNAPSHOT artifact is indeed available on the public sonatype repo (not the snapshot repo), but that's not included as a default resolver in SBT. It's interesting that a SNAPSHOT is published there.

I was able to compile a test project with Java 11 once I added that repo.

For reference:

lazy val root = (project in file("."))
  .settings(
    name := "seed-project",
    resolvers ++= Seq(
      MavenRepo("confluent", "https://packages.confluent.io/maven/"),
      Resolver.sonatypeRepo("public")
    ),
    libraryDependencies ++= Seq(
      "io.confluent" % "rest-utils" % "5.4.0"
    )
  )

Yeah, definitely not ideal to have SNAPSHOTs in the dependency tree. I'll look at upgrading jersey as well, but since upgrades add risk on older release branches, probably still useful to have the info here.