Skip to content

Fix #8252: Remove incorrect maven-artifact exclusion causing Debezium…#8265

Open
sanjana2505006 wants to merge 2 commits intoapache:mainfrom
sanjana2505006:fix/debezium-native-compilation
Open

Fix #8252: Remove incorrect maven-artifact exclusion causing Debezium…#8265
sanjana2505006 wants to merge 2 commits intoapache:mainfrom
sanjana2505006:fix/debezium-native-compilation

Conversation

@sanjana2505006
Copy link
Contributor

This PR addresses the ClassNotFoundException: org.apache.maven.artifact.versioning.InvalidVersionSpecificationException encountered during native compilation of Debezium extensions.

The issue was traced to an incorrect exclusion of maven-artifact in the extensions-support/debezium/deployment/pom.xml. This exclusion prevented essential Maven versioning classes (required by the Debezium engine at build time) from being available to the Quarkus native image generator.

Changes:

  • Removed <exclusion> for maven-artifact in camel-quarkus-support-debezium-deployment.

Verification:

@sanjana2505006
Copy link
Contributor Author

@jamesnetherton Whenever you get a chance, please review and let me know if any changes are needed

@jamesnetherton
Copy link
Contributor

I suspect removing the exclusion is only part of the fix. You'd need to run the native integration tests for each module in here to verify it:

https://github.com/apache/camel-quarkus/tree/main/integration-test-groups/debezium

There are likely additional things that need fixing...

…sources to avoid static config initialization
@sanjana2505006
Copy link
Contributor Author

@jamesnetherton Thank you for the feedback!

I have refactored the test resources for all Debezium modules (MongoDB, MySQL, PostgreSQL, MSSQL, Oracle) to avoid static initialization of configuration properties. This should prevent the ServiceConfigurationError and ClassNotFoundException that often occur during native testing when ConfigProvider is accessed too early.

I also re-applied the maven-artifact exclusion removal.

I wasn't able to run the full native verification locally due to missing Docker/native tools in my environment, but I've verified that the code changes align with native best practices. Relying on the CI to confirm everything is green now.

@jamesnetherton
Copy link
Contributor

This should prevent the ServiceConfigurationError and ClassNotFoundException that often occur during native testing when ConfigProvider is accessed too early.

Not sure that's a concern here. I have never seen any issues related to that. Those QuarkusTestResource classes are just run from JUnit extensions and are scoped to the test classpath.

Also, we maybe don't want to start shifting the test container configuration around in the project. The convention we (mostly) followed so far is that such things are defined as constants and then queried in the start() method etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants