Quarkus throws org.jboss.jandex.UnsupportedVersion: Version: 10 during tests

5.2k views Asked by At

We have some Quarkus service that depends on a module that has a Jandex index in it.

Now when we run a test that has @QuarkusTest annotation in it we get the error:

org.jboss.jandex.UnsupportedVersion: Version: 10

We are using Quarkus 2.2.1.Final and Jandex plugin 1.1.0 (I also tried 1.2.0 of the plugin)

2

There are 2 answers

1
gkephorus On

We found that the Jandex plugin version 1.1.0 & 1.2.0 both cause this but version 1.1.1 works nicely.

0
Ladicek On

This is because the Jandex index was generated by Jandex 2.4.0.Final, which uses a newer version of the index format (version 10, specifically). Quarkus 2.2 uses Jandex 2.3.1.Final, which doesn't understand the new index format (it only understands version less than or equal to 9).

There are 2 common ways how the Jandex Maven plugin can use Jandex 2.4.0.Final:

  1. If you don't specify a Jandex dependency for the Jandex Maven plugin, Jandex Maven plugin will use whatever it was built with. That is, Jandex Maven plugin 1.2.0 will use Jandex 2.4.0.Final. Earlier versions of the Jandex Maven plugin use earlier Jandex versions.
  2. If you specify a Jandex dependency for the Jandex Maven plugin, the Jandex Maven plugin will happily use it.

Unfortunately, Jandex itself and the Jandex Maven plugin have different versions, so it's not exactly straightforward to know which Jandex version is used by given Jandex Maven plugin version. This will change starting with Jandex 3.0, where they will be released together under the same version number.

Also, Jandex unfortunately didn't have a written compatibility promise. I added one here: https://github.com/wildfly/jandex/pull/136