We have a rule to prevent imports on several Apache Commons project using the following regex ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*.

We learned the hard way this rule does not work (see #23059). We also have legit imports on dbcp2 that are legit.

Comment From: dreis2211

The rule includes a negative lookahead that, so it basically disallows everything but the alternatives provided in the regex. dbcp2 is therefore allowed and lang as well.

The question is what should be allowed. Imho lang & lang3 should be simply removed there and everything else can stay as there seem to be legit imports in the project. If that is what you had in mind @snicoll I can provide a PR.

Comment From: snicoll

Removing lang and lang3 sounds about right @dreis2211. If you have time to prepare a PR targeted at 2.1.x that would be great!

Comment From: dreis2211

@snicoll done

Comment From: snicoll

Thanks. Closing in favour of PR #23071