Skip to content

Gradle: :quarkusDependenciesBuild uses this output of :jandex without declaring dependency #43952

@joschi

Description

@joschi

Describe the bug

A new minimal Quarkus project using Gradle 8.10. as build system fails to build due to a missing dependency declaration to the org.kordamp.gradle.jandex plugin.

Expected behavior

Build should be successful.

When removing the Jandex plugin from build.gradle.kts, the build succeeds:

❯ ./gradlew build

BUILD SUCCESSFUL in 1s
7 actionable tasks: 6 executed, 1 up-to-date

Actual behavior

❯ ./gradlew build
> Task :quarkusDependenciesBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':quarkusDependenciesBuild' (type 'QuarkusBuildDependencies').
  - Gradle detected a problem with the following location: '/path/to/quarkus-jandex/build/resources/main'.
    
    Reason: Task ':quarkusDependenciesBuild' uses this output of task ':jandex' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':jandex' as an input of ':quarkusDependenciesBuild'.
      2. Declare an explicit dependency on ':jandex' from ':quarkusDependenciesBuild' using Task#dependsOn.
      3. Declare an explicit dependency on ':jandex' from ':quarkusDependenciesBuild' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.10.2/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
7 actionable tasks: 5 executed, 2 up-to-date

How to Reproduce?

build.gradle.kts:

plugins {
	java
	id("org.kordamp.gradle.jandex") version "2.0.0"
	id("io.quarkus") version "3.15.1"
}

repositories {
	mavenCentral()
}

dependencies {
	implementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:3.15.1"))
}

group = "com.example"
version = "1.0.0-SNAPSHOT"

settings.gradle.kts:

pluginManagement {
	repositories {
		mavenCentral()
		gradlePluginPortal()
	}
}
rootProject.name = "jandex-dependency"

There are no other source files in src/ whatsoever.

Output of uname -a or ver

Darwin macbook.local 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:04 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6030 arm64

Output of java -version

openjdk 21.0.5 2024-10-15 LTS

Quarkus version or git rev

3.15.1

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.10.2

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    3.20.3

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions