Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot validate extension in multi-project Gradle build #42054

Open
mikethecalamity opened this issue Jul 22, 2024 · 7 comments
Open

Cannot validate extension in multi-project Gradle build #42054

mikethecalamity opened this issue Jul 22, 2024 · 7 comments
Labels
area/gradle Gradle kind/bug Something isn't working

Comments

@mikethecalamity
Copy link

mikethecalamity commented Jul 22, 2024

Describe the bug

I created a custom extension in my multi-project Gradle build. But I cannot build the extension project solo (gradlew -p <project> <subproject>:build). But the build succeeds when I build everything (gradlew -p <project> build).

Expected behavior

Successful build

Actual behavior

Configuration on demand is an incubating feature.

> Task :json-logging:validateExtension FAILED
Quarkus Extension Dependency Verification Error
The following deployment artifact(s) were found to be missing in the deployment module:
- io.quarkus:quarkus-jsonp-deployment
- io.quarkus:quarkus-core-deployment

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':json-logging:validateExtension'.
> Quarkus Extension Dependency Verification Error. See logs below

* 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
6 actionable tasks: 1 executed, 5 up-to-date

How to Reproduce?

Reproducer:

  1. Clone https://github.com/mikethecalamity/quarkus-test
  2. ./gradlew -p extensions json-logging:build

Output of uname -a or ver

No response

Output of java -version

JDK 17

Quarkus version or git rev

Quarkus 3.12.3

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

Gradle 8.9

Additional information

No response

@mikethecalamity mikethecalamity added the kind/bug Something isn't working label Jul 22, 2024
@quarkus-bot quarkus-bot bot added the area/gradle Gradle label Jul 22, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 22, 2024

/cc @glefloch, @quarkusio/devtools

@aloubyansky
Copy link
Member

It looks like it can't resolve the deployment project for validation purposes. I am not sure we can do much about it but build extensions completely or disable validateExtension task

@mikethecalamity
Copy link
Author

@aloubyansky Could I add something to the json-logging/build.gradle like:

afterEvaluate {
    validateExtension.dependsOn project(':json-logging-deployment').???
}

I just don't know what task from json-logging-deployment that it depends on.

@aloubyansky
Copy link
Member

Afaiu, the deployment subproject needs to be a part of the project build, since this task is validating its dependencies.
You need to be careful not to introduce a cyclic dependency, since deployment depends on runtime.
Practically though, I am not sure why you would not want to build them as a "unit".

@mikethecalamity
Copy link
Author

I do want to build them as a "unit", but the way builds work for our system requires everything to be able to be built "solo". And I use quotes there because json-logging-deployment can be built as part of json-logging, if there's a way I can add it to the build.gradle. Such that building the json-logging project builds them both. I'm just not sure what I could add in either of their build.gradles to accomplish this.

@aloubyansky
Copy link
Member

I think for the validation to work, the deployment subproject has to be included in the build. TBH, I am not sure how you can do that from the runtime subproject, except building the whole "extension" (https://github.com/mikethecalamity/quarkus-test/tree/master/extensions
/subprojects)
Alternatively, validateExtension task could be disabled. Perhaps, we should just move validateExtension to the deployment module but it would still be validating the runtime one.

@mikethecalamity
Copy link
Author

I'll disable validateExtension for now. But it does sound reasonable for it to be on the deployment module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants