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(deps): exclude commons-logging from shaded jar #88

Closed
wants to merge 1 commit into from
Closed

chore(deps): exclude commons-logging from shaded jar #88

wants to merge 1 commit into from

Conversation

strangelookingnerd
Copy link

@strangelookingnerd strangelookingnerd commented Apr 9, 2024

Context: camunda/camunda-bpm-platform#3673

This changes excludes commons-logging from the shaded camunda-connect-connectors-all jar.
The dependencey is initially declared by org.apache.httpcomponents:httpclient through camunda-connect-http-client.
On further investigation there seems to be no need for it to be included during runtime.

On a side-note:
This repo seems pretty out-dated in terms of dependency versions.
Is there a general interest in upgrading those by adding renovate / dependabot to this repo?
Additionally, is there any interest in a httpclient5 implementation? I'd be happy to look into it.

@yanavasileva
Copy link
Member

Hi @strangelookingnerd,

Thank you for your contribution.
I will look into the topic (can we exclude the library from the shaded jar) and get back to you.

Best,
Yana

@yanavasileva
Copy link
Member

Notes to myself:

Details
  • camunda-connect-connectors-all contains the HTTP and SOAP connectors as well as their dependencies. To avoid conflicts with other versions of these dependencies, the dependencies are relocated to different packages.
  • the classes of the shaded apache libraries are compiled/used with the connectjar prefix inside connectors-all.
    • if we exclude the commons-logging libraries (without additional changes), the below error will occur.
  • connectors-all is used in engine to send telemetry data. If we disable/remove sending telemetry (already discussed in the team), we (might) can drop the dependency from the engine. For spring boot that might resolve the necessity to exclude the commons-logging library from the shaded jar as the transitive dependency will no longer exist. Only the users that have explicit dependency to the library will have the warning to remove the commons-logging from the classpath. Which might be a common scenario since Spring Framework offers a few REST clients.
java.lang.NoClassDefFoundError: connectjar/org/apache/commons/logging/LogFactory
	at connectjar.org.apache.http.conn.ssl.DefaultHostnameVerifier.<init>(DefaultHostnameVerifier.java:82)
	at connectjar.org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966)
	at connectjar.org.apache.http.impl.client.HttpClients.createSystem(HttpClients.java:64)
	at org.camunda.connect.httpclient.impl.AbstractHttpConnector.createClient(AbstractHttpConnector.java:58)
	at org.camunda.connect.httpclient.impl.AbstractHttpConnector.<init>(AbstractHttpConnector.java:53)
	at org.camunda.connect.httpclient.impl.HttpConnectorImpl.<init>(HttpConnectorImpl.java:31)
	at org.camunda.connect.httpclient.impl.HttpConnectorProviderImpl.createConnectorInstance(HttpConnectorProviderImpl.java:29)
	at org.camunda.connect.httpclient.impl.HttpConnectorProviderImpl.createConnectorInstance(HttpConnectorProviderImpl.java:22)
	at org.camunda.connect.Connectors.registerProvider(Connectors.java:186)
	at org.camunda.connect.Connectors.registerConnectors(Connectors.java:176)
	at org.camunda.connect.Connectors.initializeConnectors(Connectors.java:163)
	at org.camunda.connect.Connectors.ensureConnectorProvidersInitialized(Connectors.java:149)
	at org.camunda.connect.Connectors.getConnectorById(Connectors.java:138)
	at org.camunda.connect.Connectors.getConnector(Connectors.java:77)
	at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.initTelemetry(ProcessEngineConfigurationImpl.java:2956)
	at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:1219)
	at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:1158)

@strangelookingnerd
Copy link
Author

Just for the record, #89 would supersede this PR as httpclient5 does no longer depend on commons-logging from what I can see.

@strangelookingnerd
Copy link
Author

Replaced by camunda/camunda-bpm-platform#4408

@strangelookingnerd strangelookingnerd deleted the exclude-commons-logging branch June 6, 2024 11:03
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