Coder Social home page Coder Social logo

jenkinsci / apache-httpcomponents-client-5-api-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 39 KB

Bundles Apache HttpComponents Client 5.x and allows it to be used by Jenkins plugins.

Home Page: https://plugins.jenkins.io/apache-httpcomponents-client-5-api

License: MIT License

apache apache-httpclient apache-httpcomponents build http-client jenkins jenkins-library jenkins-plugin jenkins-security-scan-enabled library

apache-httpcomponents-client-5-api-plugin's Introduction

Apache HttpComponents Client 5.x API Plugin for Jenkins

icon badge

apache httpcomponents client 5 api apache httpcomponents client 5 api plugin apache httpcomponents client 5 api plugin

This plugin bundles all the components of Apache HttpComponents Client 5.x except httpclient5-win because of the dependency on jna.

These components can be used by other plugins as a dependency. It allows managing library updates independently of plugins.

How to introduce to your plugin

Plugins directly depending on httpclient5

Replace the dependency to org.apache.httpcomponents.client5:httpclient5 with the dependency to apache-httpcomponents-client-5-api.

Avoid version conflicts by using the Jenkins Plugin BOM rather than depending on a specific version.

Before:

<dependencies>
  ...
  <dependency>
    <groupId>org.apache.httpcomponents.client5</groupId>
    <artifactId>httpclient5</artifactId>
    <version>5.2.1</version>
  </dependency>
  ...
</dependencies>

After:

<dependencies>
  ...
  <dependency>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>apache-httpcomponents-client-5-api</artifactId>
  </dependency>
  ...
</dependencies>

Plugins using libraries depending on httpclient5

Add the dependency to apache-httpcomponents-client-5-api before any of dependencies to those libraries to force maven to use httpclient5 declared by apache-httpcomponents-client-5-api.

Avoid version conflicts by using the Jenkins Plugin BOM rather than depending on a specific version.

Before:

<dependencies>
  ...
  <dependency>
    <artifactId>somelibrary-using-httpclient5</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <artifactId>anotherlibrary-using-httpclient5</artifactId>
    <version>1.0.0</version>
  </dependency>
  ...
</dependencies>

After:

<dependencies>
  ...
  <dependency>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>apache-httpcomponents-client-5-api</artifactId>
  </dependency>
  <dependency>
    <artifactId>somelibrary-using-httpclient5</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <artifactId>anotherlibrary-using-httpclient5</artifactId>
    <version>1.0.0</version>
  </dependency>
  ...
</dependencies>

Versioning

Version follows the pattern of <org.apache.httpcomponents.client5 version>-<plugin version>. This way it is clear what upstream dependency is offered and allows patch releases for the plugin itself if required.

Since org.apache.httpcomponents.client5 artifacts have a release cycle that is independent from org.apache.httpcomponents.core5 artifacts, the latter are included in patch releases for this plugin.

Release Notes

Release notes are recorded in GitHub Releases.

License

apache-httpcomponents-client-5-api-plugin's People

Contributors

dependabot[bot] avatar renovate[bot] avatar strangelookingnerd avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

apache-httpcomponents-client-5-api-plugin's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/jenkins-security-scan.yml
  • jenkins-infra/jenkins-security-scan v2
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v6
maven
pom.xml
  • org.jenkins-ci.plugins:plugin 4.78
  • org.apache.httpcomponents.core5:httpcore5 5.2.4
  • org.apache.httpcomponents.core5:httpcore5-h2 5.2.4
  • org.apache.httpcomponents.core5:httpcore5-reactive 5.2.4
  • org.apache.httpcomponents.client5:httpclient5 5.3.1
  • org.apache.httpcomponents.client5:httpclient5-cache 5.3.1
  • org.apache.httpcomponents.client5:httpclient5-fluent 5.3.1
regex
.mvn/extensions.xml
  • io.jenkins.tools.incrementals:git-changelist-maven-extension 1.7

  • Check this box to trigger a request for Renovate to run again on this repository

Access to Docker Unix socket is broken

Jenkins and plugins versions report

There are only two Jenkins: 2.430
OS: Linux - 5.15.0-89-generic
Java: 17.0.8.1 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

ant:497.v94e7d9fffa_b_9
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.2.3-1.0
authentication-tokens:1.53.v1c90fd9191a_b_
bootstrap5-api:5.3.2-2
bouncycastle-api:2.29
branch-api:2.1135.v8de8e7899051
build-timeout:1.31
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.0.2
cloud-stats:320.v96b_65297a_4b_b_
cloudbees-folder:6.858.v898218f3609d
commons-lang3-api:3.13.0-62.v7d18e55f51e2
commons-text-api:1.11.0-94.v3e1f4a_926e49
configuration-as-code:1746.vf1673cfe690a
credentials:1309.v8835d63eb_d8a_
credentials-binding:642.v737c34dea_6c2
display-url-api:2.200.vb_9327d658781
docker-build-step:2.10
docker-commons:439.va_3cb_0a_6a_fb_29
docker-java-api:3.3.4-86.v39b_a_5ede342c
docker-plugin:1.5
docker-workflow:572.v950f58993843
durable-task:523.va_a_22cf15d5e0
echarts-api:5.4.3-1
email-ext:2.102
font-awesome-api:6.4.2-1
git:5.2.0
git-client:4.5.0
github:1.37.3.1
github-api:1.318-461.v7a_c09c9fa_d63
github-branch-source:1741.va_3028eb_9fd21
gradle:2.9
hashicorp-vault-plugin:361.v44fea_4fc08d9
instance-identity:185.v303dc7c645f9
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.3-372.v309620682326
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:243.vb_b_503b_b_45537
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.9-1
jjwt-api:0.11.5-77.v646c772fddb_0
jquery3-api:3.7.1-1
jsch:0.2.8-65.v052c39de79b_2
junit:1240.vf9529b_881428
ldap:711.vb_d1a_491714dc
mailer:463.vedf8358e006b_
matrix-auth:3.2.1
matrix-project:818.v7eb_e657db_924
maven-plugin:3.23
mina-sshd-api-common:2.11.0-86.v836f585d47fa_
mina-sshd-api-core:2.11.0-86.v836f585d47fa_
okhttp-api:4.11.0-157.v6852a_a_fa_ec11
pam-auth:1.10
pipeline-build-step:516.v8ee60a_81c5b_9
pipeline-github-lib:42.v0739460cda_c4
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:689.veec561a_dee13
pipeline-input-step:477.v339683a_8d55e
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2151.ve32c9d209a_3f
pipeline-model-definition:2.2151.ve32c9d209a_3f
pipeline-model-extensions:2.2151.ve32c9d209a_3f
pipeline-rest-api:2.34
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2151.ve32c9d209a_3f
pipeline-stage-view:2.34
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.6.0
prism-api:1.29.0-9
resource-disposer:0.23
scm-api:683.vb_16722fb_b_80b_
script-security:1294.v99333c047434
snakeyaml-api:2.2-111.vc6598e30cc65
ssh-credentials:308.ve4497b_ccd8f4
ssh-slaves:2.916.vd17b_43357ce4
structs:325.vcb_307d2a_2782
timestamper:1.26
token-macro:384.vf35b_f26814ec
trilead-api:2.84.v72119de229b_7
variant:60.v7290fc0eb_b_cd
workflow-aggregator:596.v8c21c963d92d
workflow-api:1283.v99c10937efcb_
workflow-basic-steps:1042.ve7b_140c4a_e0c
workflow-cps:3812.vc3031a_b_a_c955
workflow-durable-task-step:1289.v4d3e7b_01546b_
workflow-job:1360.vc6700e3136f5
workflow-multibranch:756.v891d88f2cd46
workflow-scm-step:415.v434365564324
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:865.v43e78cc44e0d
ws-cleanup:0.45

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 22.04.
Running jenkins as a docker image based from jenkins/jenkins:2.430-jdk17

Reproduction steps

  • Run default setup of jenkins docker with
  • JAVA_OPTS: -Djenkins.install.runSetupWizard=false
  • Mount /var/run/docker.sock from host to jenkins docker image
  • Install default plugins.
  • Install latest https://plugins.jenkins.io/docker-build-step/ plugin.
  • Restart.
  • Go to manage jenkins -> System -> Docker URL
  • Set it to unix:///var/run/docker.sock so the nodes can communicate with docker.
  • Click on test. and you get an error
    Something went wrong, cannot connect to unix:///var/run/docker.sock, cause: org.apache.hc.client5.http.HttpHostConnectException: Connect to unix://localhost:2375 [localhost/127.0.0.1] failed: Connection refused

Expected Results

After troubleshooting, I have discovered that your plugin is the root cause.
The version 5.2.1-1.1 works as expected. Anything afterwards breaks.

Actual Results

Something went wrong, cannot connect to unix:///var/run/docker.sock, cause: org.apache.hc.client5.http.HttpHostConnectException: Connect to unix://localhost:2375 [localhost/127.0.0.1] failed: Connection refused

Anything else?

The setup is plain and default. Nothing was changed to docker on the host

Are you interested in contributing a fix?

Sure. I need this fixed. Right now, I have to manually downgrade your package as I have not found a fix for the error.

Connexion to secure Docker API KO with version 5.2.2-1.0+

Jenkins and plugins versions report

Environment
Jenkins: 2.426.1
OS: Linux - 5.10.0-26-amd64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
[redacted]
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.2.1-1.1
[redacted]
docker-commons:439.va_3cb_0a_6a_fb_29
docker-java-api:3.3.4-86.v39b_a_5ede342c
docker-plugin:1.5
docker-workflow:572.v950f58993843
[redacted]

What Operating System are you using (both controller, and any agents involved in the problem)?

Debian 11
Jenkins: 2.426.1
OS: Linux - 5.10.0-26-amd64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
Docker version 24.0.7, build afdd53b

Reproduction steps

Jenkins LTS docker container (2.426.1), (configuration as code).
docker-plugin and docker-workflow latest versions.
apache-httpcomponents-client-5-api will be installed as dependency.
Configure a docker cloud with secure API (port 2376, self signed certificates) tcp://hostname:2376 and credential as x509 certificate.

Expected Results

Test connection should return docker version, such as Version = 24.0.7, API Version = 1.43
This is the result obtained with apache-httpcomponents-client-5-api:5.2.1-1.1

Actual Results

with apache-httpcomponents-client-5-api:5.2.2-1.0+ result is
jenkins | 2023-11-28 20:37:15.016+0000 [id=107] WARNING c.n.j.p.d.DockerContainerWatchdog#retrieveContainers: Unable to retrieve list of containers available on DockerCloud [name=docker on [REDACTED CLOUD NAME], dockerURI=tcp://[redacted hostname]:2376] while reading list of containers (showAll=true, labelFilters={com.nirima.jenkins.plugins.docker.JenkinsId=5297234496d116d39f2ec5c643870a08})
jenkins | java.lang.IllegalArgumentException: Invalid Proxy
jenkins | at java.base/java.net.Socket.(Socket.java:177)
jenkins | at org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.createSocket(SSLConnectionSocketFactory.java:208)
jenkins | at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)
jenkins | at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:447)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172)
jenkins | at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:115)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
jenkins | at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
jenkins | at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:191)
jenkins | at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74)
jenkins | at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:44)
jenkins | at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:15)
jenkins | at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
jenkins | at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.retrieveContainers(DockerContainerWatchdog.java:280)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.processCloud(DockerContainerWatchdog.java:219)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.execute(DockerContainerWatchdog.java:152)
jenkins | at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102)
jenkins | at java.base/java.lang.Thread.run(Thread.java:840)

Anything else?

No response

Are you interested in contributing a fix?

No response

/var/run/docker.sock is broken

Jenkins and plugins versions report

Can't, NDA.

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux (Ubuntu)

Reproduction steps

Setup Docker cloud in Jenkins.
No special configuration needed.

Expected Results

Jenkins can access Docker via unix socket, just as the elder gods intended.

Actual Results

Jenkins can't access Docker via unix socket, elder gods ain't happy.

Anything else?

First screenshot โ€” 5.2.2-1.1, broken.
Second screen shot โ€” 5.2.1-1.1, works.

5 2 2-1 1
5 2 1-1 1

Are you interested in contributing a fix?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.