Skip to content

kordamp/jandex-gradle-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

905b8ed · Jul 26, 2022

History

86 Commits
Apr 22, 2022
Jun 1, 2021
Jul 26, 2022
May 6, 2021
Nov 26, 2019
Jul 26, 2022
Jul 26, 2022
Jan 1, 2022
Jul 26, 2022
Oct 8, 2020
Oct 8, 2020
Apr 22, 2022
Jan 1, 2022

Repository files navigation

jandex-gradle-plugin

Build Status ASL2 Licensed Gradle Plugin Portal, link=


Runs jandex on a Gradle project.

Usage

Option #1

buildscript {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
    dependencies {
        classpath 'org.kordamp.gradle:jandex-gradle-plugin:0.13.0'
    }
}
apply plugin: 'org.kordamp.gradle.jandex'

Option #2

plugins {
    id 'org.kordamp.gradle.jandex' version '0.13.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.

Configuration

Plugin configuration

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

destination

File

build/jandex/jandex.idx

sources

ConfigurableFileCollection

sourceSets.main.output.classesDirs

Note
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 jandex

Jandex Version

This plugin relies on Jandex 2.4.3.Final to perform its jobs, however you may configure a different version if needed. Simply add the maven coordinates to the jandex extension as shown next

jandex {
    version = '2.2.1.Final'
}

Migration

Starting with version 0.9.0 the chosen Jandex dependency must be resolved using explicit repositories, in other words, it is no longer part of the plugin’s default classpath. Failure to declare a repository from which this dependency may be resolved will result in a build failure.