Skip to content

Testing commons-lang2 removal from jenkins-core#6234

Draft
alecharp wants to merge 13 commits intojenkinsci:masterfrom
alecharp:testing/commons-lang2-removal
Draft

Testing commons-lang2 removal from jenkins-core#6234
alecharp wants to merge 13 commits intojenkinsci:masterfrom
alecharp:testing/commons-lang2-removal

Conversation

@alecharp
Copy link
Member

This is simply to validate / see what breaks with the removal of the library from Jenkins Core.
See jenkinsci/jenkins#26105.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can update to a more recent incremental of Jenkins core.

@timja
Copy link
Member

timja commented Feb 3, 2026

I tried using openrewrite but neither the commons-lang3-api recipe or openrewrite cli seemed to do anything for me.

Gave up and just did:

rg -0 -lF 'org.apache.commons.lang.' . |
while IFS= read -r -d '' file; do
  sed -i '' 's/org.apache.commons.lang/org.apache.commons.lang3/' "$file"
done

Added the dep:

        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>commons-lang3-api</artifactId>
        </dependency>

Banned commons-lang2:

<ban-commons-lang-2.skip>false</ban-commons-lang-2.skip>

Would be nice if there was a command that could be run to just do it.
Or migrate to Java platform API...

@timja
Copy link
Member

timja commented Feb 5, 2026

@jonesbusy any idea what I was missing above? I would have thought there should be a simple method of migrating commons-lang to either java APIs or to commons-lang3

@jonesbusy
Copy link
Contributor

jonesbusy commented Feb 8, 2026

@jonesbusy any idea what I was missing above? I would have thought there should be a simple method of migrating commons-lang to either java APIs or to commons-lang3

Any error in particular?

There is a recipe that change to commons-lang3 plugin-modernizer dry-run --plugins <plugin> --recipe MigrateCommonsLang2ToLang3AndCommonText that I was using of quiet a few plugins

For native Java API it's tracked by jenkins-infra/plugin-modernizer-tool#1542

It's probably just reusing what is provided by OpenRewrite

EDIT: Not sure if related by last with infra incident but some URL that we were using to get installation data return 404

        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:50)
Caused by: io.jenkins.tools.pluginmodernizer.core.model.ModernizerException: Failed to get CSV data. Received response code: 404 from https://stats.jenkins.io/jenkins-stats/svg/202505-plugins.csv
        at io.jenkins.tools.pluginmodernizer.core.utils.CSVUtils.fromUrl(CSVUtils.java:40)

I will publish a release that ignore installation stats for now

MarkEWaite added a commit to MarkEWaite/repository-permissions-updater that referenced this pull request Feb 11, 2026
Plugin repository:

* https://github.com/jenkinsci/job-dsl-plugin

Pull request to enable automated releases (CD):

* jenkinsci/job-dsl-plugin#2563

The new release will help with the removal of Apache Commons Lang 2 from
Jenkins core.  That is currently being tested in:

* jenkinsci/jenkins#16404
* jenkinsci/bom#6234

Also updates permissions that were missed in previous changes.  Completes
the removal of @jamietanna and @daspilker as Job DSL maintainers, since
they removed themselves with earlier pull requests.

@jamietanna removed himself as a Job DSL maintainer in pull request:

* jenkins-infra#4404

@daspilker removed himself as a Job DSL maintainer in pull request:

* jenkins-infra#4385
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.

4 participants