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

Use a copy of compile classpath for panache annotation processor lookup #23881

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

glefloch
Copy link
Member

@glefloch glefloch commented Feb 22, 2022

This change looks for panache dependency on a copy of the compile classpath instead of the real compile classpath.

In some case, the annotationProcessor configuration is configured to extend compileOnly configuration. When looking up for the quarkus-panache-common dependency, we resolve the COMPILE_CLASSPATH which then make it impossible to add a dependency to the annotationProcessor configuration as a part as already been resolved.

close #23776

@glefloch glefloch requested a review from aloubyansky February 22, 2022 15:59
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Feb 22, 2022
Set<ResolvedArtifact> compileClasspathArtifacts = configContainer
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).getResolvedConfiguration()
configContainer.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME)
.defaultDependencies(annotationProcessors -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain the reason for changing to the defaultDependencies(...) here? The javadoc says

Execute the given action if the configuration has no defined dependencies when it first participates in dependency resolution.

Would it still work if there already are some default dependencies and the quarkus-panache-common is not among them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the error message but as you mentioned this is not what we are looking for.
The withDependencies should be ok. I will give it a try.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replace the defaultDependencies by the withDependencies which always runs before dependency resolution.

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 22, 2022

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 3ec017e

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Build Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.AnnotationProcessorSimpleModuleTest.shouldContainsPanacheMarkerFile line 31 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.AnnotationProcessorSimpleModuleTest.shouldContainsPanacheMarkerFile line 31 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

@glefloch glefloch merged commit ce6662b into quarkusio:main Feb 23, 2022
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Feb 23, 2022
@glefloch glefloch deleted the fix/23776 branch February 23, 2022 09:43
@gsmet
Copy link
Member

gsmet commented Feb 28, 2022

I wasn't able to backport this one as the modified file is just not around in 2.7. If we want this in 2.7, we need a specific backport targeting the 2.7 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running gradle quarkusDev fails in a multi-module Gradle project
3 participants