Skip to content

Conversation

schuch
Copy link
Contributor

@schuch schuch commented Jul 18, 2019

This replaces the usage of org.apache.http.client.utils.URIBuilder with standard JDK API to get rid of the dependency

<dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.8</version>
</dependency>

Context (Why)

This plugin has a dependency to apache httpclient. Apache httpclient has other transitive dependencies, e.g. commons-logging. Especially commons-logging can cause class loader issues when the user's project classpath contains already a dependency to commons-logging.

In my case i ran into:

118113 [ERROR] -----------------------------------------------------: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))
118114 [ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal pl.project13.maven:git-commit-id-plugin:3.0.0:revision (default) on project dbsearch-connector-ecm: Execution default of goal pl.project13.maven:git-commit-id-plugin:3.0.0:revision failed: An API incompatibility was encountered while executing pl.project13.maven:git-commit-id-plugin:3.0.0:revision: java.lang.ExceptionInInitializerError: null

Contributor Checklist

  • Added relevant integration or unit tests to verify the changes (were already in place)
  • Update the Readme or any other documentation (including relevant Javadoc) (no occurrences found)
  • Ensured that tests pass locally: mvn clean package
  • Ensured that the code meets the current checkstyle coding style definition: mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B

@TheSnoozer
Copy link
Collaborator

Thank you for your contribution!

That indeed seems very reasonable to replace this dependency.

@TheSnoozer TheSnoozer merged commit ca97e60 into git-commit-id:master Jul 19, 2019
@TheSnoozer TheSnoozer added this to the 3.0.1 milestone Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants