Skip to content

Commit

Permalink
Provide details about failing MetaInfJandexReader
Browse files Browse the repository at this point in the history
reader.getIndexVersion() can throw UnsupportedVersion too
Example: 
Build step io.quarkus.deployment.index.ApplicationArchiveBuildStep#build threw an exception: org.jboss.jandex.UnsupportedVersion: Can't read index version 11; this IndexReader only supports index versions 2-3,6-10
        at org.jboss.jandex.IndexReader.initReader(IndexReader.java:87)
        at org.jboss.jandex.IndexReader.readVersion(IndexReader.java:140)
        at org.jboss.jandex.IndexReader.getIndexVersion(IndexReader.java:127)
        at io.quarkus.deployment.index.IndexingUtil$MetaInfJandexReader.apply(IndexingUtil.java:244)
        at io.quarkus.deployment.index.IndexingUtil$MetaInfJandexReader.apply(IndexingUtil.java:230)
        at io.quarkus.paths.PathTreeVisit.process(PathTreeVisit.java:40)
  • Loading branch information
damienb-opt committed Sep 21, 2022
1 parent b65be7e commit cb52957
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ public Index apply(PathVisit visit) {
}
try (InputStream in = Files.newInputStream(visit.getPath())) {
IndexReader reader = new IndexReader(in);
if (reader.getIndexVersion() < REQUIRED_INDEX_VERSION) {
log.warnf(
"Re-indexing %s - at least Jandex 2.1 must be used to index an application dependency",
visit.getPath());
return null;
}
try {
if (reader.getIndexVersion() < REQUIRED_INDEX_VERSION) {
log.warnf(
"Re-indexing %s - at least Jandex 2.1 must be used to index an application dependency",
visit.getPath());
return null;
}
return reader.read();
} catch (UnsupportedVersion e) {
throw new UnsupportedVersion(
Expand Down

0 comments on commit cb52957

Please sign in to comment.