-
Notifications
You must be signed in to change notification settings - Fork 21
update gitlab4j and use jersey2 and jackson2 plugins #7
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
Conversation
f922934 to
6a3dc09
Compare
|
@dcendents you should be able to deploy snapshots to Jenkins's artifactory "repo.jenkins-ci.org" |
|
Should be able to use them so Jenkins would pick them up |
|
I installed this versions on my Jenkins, and this works as expected. |
|
@dcendents Amazing! Thanks for looking at this. This should fix jenkinsci/gitlab-branch-source-plugin#151 Meanwhile... a version including gitlab4j/gitlab4j-api#806 is possibly needed much more urgently. all my gitlab builds have started failing in the last 24 hours. I'm going to be working on setting up my build environment today, to see if I can build my own snapshot plugins. But should you beat me to it, I sure there are loads of people out there who would be extremely grateful! :) |
|
@alexjfisher here you go: https://repo.jenkins-ci.org/snapshots/io/jenkins/plugins/gitlab-api/1.0.7-SNAPSHOT/gitlab-api-1.0.7-20220302.133039-2.hpi This includes gitlab4j-api with both PRs
Obviously I haven't had time to test it, but |
Great! I'll test this shortly and let you know. Many thanks. |
|
This just got a bit more complicated, so here are the plugins that need to be installed if you cannot wait for the official release:
Also if you have the |
|
@dcendents Thanks for putting it together, looks like a good cleanup :) |
Thanks for all of these. I'm currently updating jenkins itself. Was on 2.263.4 but soon found out I needed at least 2.289 |
|
I installed all of the plugins and got the following error (Jenkins 2.336)
|
Yes I got the same error because the I submitted this PR because if I updated the It seems all those plugins were ok when they all had their own private I suspect this is because https://github.com/eclipse-ee4j/jersey/search?p=1&q=getContextClassLoader https://www.jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/ |
|
Removed Jira plugin, it is working again thanks! |
|
Sorry to spam up this pull request but I just needed to thank @dcendents. That's resolved my issues that were causing some very inconvenient workarounds this past week. |
|
quick update, my pull requests on So I also need to submit a PR to I suspect everyone waiting for this PR also use the |
|
@jetersen This is now ready with the following PR as well: |
|
The bom has yet update the jersey-api plugin: jenkinsci/bom#1011 So the PR is not there yet |
|
@dcendents if you want you could pin the version till the bom get sorted out. |
|
Please go ahead and rebase with master thanks to @basil updating the POM |
|
And after rebasing you should get an incremental build, which you can then reference in the other PR instead of a manually deployed snapshot. |
|
went ahead and rebased 😅 |
pom.xml
Outdated
| <dependency> | ||
| <groupId>org.jenkins-ci.plugins</groupId> | ||
| <artifactId>apache-httpcomponents-client-4-api</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcendents any reason this was added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured this out; it's because it's needed by jersey-apache-connector but jersey2-api declares it as optional.
basil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a look at the dependency tree of org.gitlab4j:gitlab4j-api:5.0.1:
[INFO] +- org.gitlab4j:gitlab4j-api:jar:5.0.1:compile
[INFO] | +- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] | +- org.glassfish.jersey.inject:jersey-hk2:jar:2.35:compile
[INFO] | | +- org.glassfish.hk2:hk2-locator:jar:2.6.1:compile
[INFO] | | | +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.6.1:compile
[INFO] | | | +- org.glassfish.hk2:hk2-api:jar:2.6.1:compile
[INFO] | | | \- org.glassfish.hk2:hk2-utils:jar:2.6.1:compile
[INFO] | | \- org.javassist:javassist:jar:3.25.0-GA:compile
[INFO] | +- org.glassfish.jersey.connectors:jersey-apache-connector:jar:2.35:compile
[INFO] | | \- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] | +- org.glassfish.jersey.media:jersey-media-multipart:jar:2.35:compile
[INFO] | | \- org.jvnet.mimepull:mimepull:jar:1.9.13:compile
[INFO] | +- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.35:compile
[INFO] | | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.35:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.2:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.2:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.12.2:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.2:compile
[INFO] | | \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] | +- jakarta.servlet:jakarta.servlet-api:jar:4.0.4:compile
[INFO] | \- uk.org.webcompere:system-stubs-jupiter:jar:1.2.0:compile
[INFO] | \- uk.org.webcompere:system-stubs-core:jar:1.2.0:compile
jakarta.activation:jakarta.activation-api should not be bundled in this plugin; rather, exclude it and depend on
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>javax-activation-api</artifactId>
<version>1.2.0-2</version>
</dependency>
uk.org.webcompere:system-stubs-jupiter and uk.org.webcompere:system-stubs-core look like mocking/test libraries. Probably an upstream issue that these are not in <scope>test</scope>, but in the meantime we should work around that by not bundling them in this Jenkins plugin.
jakarta.servlet:jakarta.servlet-api is provided by core and should be excluded.
Please also add comments for each exclusion explaining where the classes come from (core, a plugin, etc).
|
@basil thanks for digging into it, already created: gitlab4j/gitlab4j-api#840 |
| <!-- Needed by jersey-apache-connector, but jersey2-api plugin declares it as optional --> | ||
| <dependency> | ||
| <groupId>org.jenkins-ci.plugins</groupId> | ||
| <artifactId>apache-httpcomponents-client-4-api</artifactId> | ||
| </dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be fixed in jersey2-api and make it non optional? again apache-httpcomponents-client-4-api is pretty much in all Jenkins installs anyhow.
@basil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. The downside is that someone who wants to use some other parts of Jersey 2 but doesn't need the Jersey Apache connector would be forced to install it. That might not be so bad, after all. I could go either way, don't feel strongly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither, I was simply wondering so 🤷♂️
|
Check this out, I ported If feasible (I have no way to test) that would be a huge boon for the maintainability of |
|
@callum-p @albertvveld @mymarche @alexjfisher You should be able to pickup the HPI for gitlab-api and gitlab-branch-source plugin to verify |
|
Yes, and I know I'm hijacking this thread but if I could have any volunteers to test the incremental from jenkinsci/gitlab-oauth-plugin#66 that would be super cool =) |
|
@dcendents link to see current commit author: https://github.com/jenkinsci/gitlab-api-plugin/commit/a3711d5d3b1c6b8771b54ca247c8fa7b32452c5c.patch |
|
@dcendents your welcome 😅 FYI I have created jenkinsci/jira-plugin#435 |
Updated the plugin to use the
jersey2-apiandjackson2-apiplugins instead of packaging its own version of jersey.This PR requires a modification ofgitlab4j-apiand alsojersey2-apigitlab4j/gitlab4j-api#795jenkinsci/jersey2-api-plugin#9fixes #8
Once this PR is merged and released, we also need to release
gitlab-branch-source-pluginwith the following PRjenkinsci/gitlab-branch-source-plugin#188
This will fix the following error I had if I installed the
jersey2-apiplugin in jenkins: