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

chore(build): add maven shade plugin where missing #165

Merged
merged 2 commits into from
Dec 29, 2022
Merged

Conversation

chillleader
Copy link
Member

Description

Maven Shade plugin config is missing in most connectors, which leads to failures during classpath bundling (without Maven)

Related issues

related to https://github.com/camunda/team-connectors/issues/258

@chillleader chillleader requested a review from a team December 28, 2022 12:23
@tmetzke
Copy link
Member

tmetzke commented Dec 28, 2022

Why exactly is the classpath bundle failing? If all connectors and the runtime use the same Jackson version, it should just work fine, shouldn't it? Might rather point out a version mismatch issue we have somewhere else. 🤔

@chillleader
Copy link
Member Author

chillleader commented Dec 28, 2022

Why exactly is the classpath bundle failing? If all connectors and the runtime use the same Jackson version, it should just work fine, shouldn't it?

There's still a mismatch between the versions used in connector-runtime (and transitively connector-sdk) and the connectors in this repository. Specifically, runtime 0.4.x brings jackson 2.13.x which overrides what we have in this repo. Connector jars with dependencies, however, already contain jackson 2.14.x.

We may also fix this by releasing the new version of the SDK, but I think it will also be nice to keep jackson shaded, otherwise we'll still face this issue in the future. Besides, since SDK & runtime and bundle have different version semantics, someone will inevitably try to use the mismatching versions in a Docker bundle and catch this error.

@chillleader
Copy link
Member Author

chillleader commented Dec 28, 2022

On the other hand, we can create one shaded dependency for the whole bundle, e.g. connectors.com.fasterxml.jackson instead of connectoraws.com.fasterxml.jackson, connectorsns.com.fasterxml.jackson etc... - because all connectors of the same version are now guaranteed to have the same version of jackson.

@tmetzke
Copy link
Member

tmetzke commented Dec 28, 2022

Ok I see, makes sense. Also provides a good practice template for others maybe. I was wondering if we should exclude this shading when we build the default Maven Bundle. It shouldn't be necessary there and might actually create some overhead we don't need. But just a thought, might also be wrong.

@chillleader
Copy link
Member Author

Good point. As far as I can see by inspecting the resulting JARs, this shade is not applied when building the default bundle - it's only active for individual connector-with-dependencies artifacts.

@tmetzke
Copy link
Member

tmetzke commented Dec 29, 2022

Yeah, makes sense actually, now that I think about it. The bundle uses the "plain" artifacts of the Connectors as dependencies. Thanks for looking into it.

I think the idea with a common relocation for all Connectors is really nice. 👍

@chillleader chillleader merged commit cb925c1 into main Dec 29, 2022
@chillleader chillleader deleted the add-shade branch December 29, 2022 10:53
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.

4 participants