Update commons-beanutils to 1.11.0 - #9483
Merged
Merged
Conversation
commons-beanutils enters the build transitively through three introducers: net.sf.json-lib (1.8.0), commons-digester (1.6) and less4j (1.8.3). Resolution therefore varied from module to module, with most modules landing on 1.6 through Maven nearest-wins. Pin the version in the root dependencyManagement so that every module resolves 1.11.0, the current release. commons-digester stays at 1.6: it is needed by jzkit-service, whose published pom declares no dependencies at all, so GeoNetwork has to supply it by hand. The direct PropertyUtils.getProperty callers in XslUtil and the json-lib code paths were checked to behave identically under 1.8.0 and 1.11.0, and the JZKit Spring context still initialises, which exercises commons-digester 1.6 against the newer beanutils.
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins
commons-beanutilsto 1.11.0 in the rootdependencyManagement, so that all modules resolve the same, current version.Why
commons-beanutilsis never declared directly. It arrives transitively through three introducers, each pulling a different version:net.sf.json-lib:json-lib:2.4common/pom.xmlcommons-digester:1.6core/pom.xml,web/pom.xmlcom.github.sommeri:less4j:1.8.4wro4j/pom.xmlMaven nearest-wins then resolves a different version per module. Before this change,
dependency:treeacross the 39 reactor modules reports:After:
1.11.0 is the latest release of the 1.x line. The 2.x line is not an option here: it lives under a different coordinate (
org.apache.commons:commons-beanutils2), has only milestone releases, and repackages toorg.apache.commons.beanutils2, so the third-party jars that consume it would not link against it.commons-collectionsis unaffected: it resolves to 3.2.2 both before and after.commons-digester stays at 1.6
Removing it looks tempting, since nothing in GeoNetwork's own source references it, but it is required at runtime.
jzkit-serviceusesorg.apache.commons.digester.DigesterinXMLImpl, and thejzkit-servicepom published to the OSGeo repository declares no dependencies at all, so GeoNetwork has to supply digester by hand.JZkitApplicationContext.xmlis imported unconditionally fromconfig-spring-geonetwork.xml, andXMLImplbuilds itsDigesterinstances during bean initialisation, so dropping the declaration breaks startup. ThedependencyManagemententry overrides the transitive resolution regardless, so digester no longer drags 1.6 along.Testing
mvn clean install -DskipTests— all 39 modules build.common,domain,core,servicesandweb— 561 tests, no failures or errors.commons-beanutils-1.11.0.jar.PropertyUtils.getPropertycallers inXslUtil(nested dotted paths over a Jackson-parsed map, the null branch for absent keys, and a key namedclass) and the json-lib paths (Xml.getJSON,Xml.getXmlFromJSON,ObjectJSONUtils.extractFieldFromJSONString,JSONObject.fromObject) were exercised under both 1.8.0 and 1.11.0, with identical results. This matters because 1.9.4 and later suppress theclassproperty by default.NoClassDefFoundErrororNoSuchMethodErrorin the logs.