Option #1
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath 'org.kordamp.gradle:jandex-gradle-plugin:2.3.0'
}
}
apply plugin: 'org.kordamp.gradle.jandex'Option #2
plugins {
id 'org.kordamp.gradle.jandex' version '2.3.0'
}This will add a jandex task to your build, which will analyze the main sourceSets by default, the generated index
will be placed in ${project.tasks.processResources.destinationDir}/META-INF/jandex.idx.
|
ℹ️
|
Requires Java 11+ and Gradle 8+. |
The following properties can be specified in the jandex task configuration
| Name | Option | Property | Type | Default Value |
|---|---|---|---|---|
processDefaultFileSet |
jandex-process-default-file-set |
jandex.process.default.file.set |
boolean |
true |
includeInJar |
jandex-includein-jar |
jandex.include.in.jar |
boolean |
true |
indexName |
jandex-index-name |
jandex.index.name |
String |
jandex.idx |
indexVersion |
jandex-index-version |
jandex.index.version |
Integer |
|
destination |
File |
build/jandex/jandex.idx |
||
sources |
ConfigurableFileCollection |
sourceSets.main.output.classesDirs |
|
ℹ️
|
The generated index file will be copied to build/resources/main/META-INF/jandex.idx during the invocation of the
`processResources task if the includeInJar property is set to true.
|
Task properties may be defined on the command line using their option name, or their property name, such as
$ gradle jandex --jandex-index-name foo.idx
$ gradle jandex -Pjandex.index.name=foo.idx
$ gradle jandex -Djandex.index.name=foo.idx
$ set JANDEX_INDEX_NAME=foo.idx
$ gradle jandexThis plugin relies on Jandex 3.1.7 to perform its job, however you may configure a different version if needed.
Simply add the desired version (for the maven coordinates io.smallrye:jandex:<version>) to the jandex extension as shown next
jandex {
version = '3.5.0'
}|
|
This plugin supports Jandex 3 as a minimum since version 1.0.0.
|
To generate reproducible Jandex indexes, serialized index representations are equal across all builds, Jandex version 3.5.0 or newer is required.
To enable reproducible jar files in Gradle, visit the Gradle docs.