From c101817aab56c0ec5cb4089e800c7b248e99701b Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Wed, 2 Oct 2024 11:49:27 +0100 Subject: [PATCH] Correct handling for embedded properties and plugins --- .../org/commonjava/maven/ext/core/util/PropertiesUtils.java | 6 ------ .../commonjava/maven/ext/core/util/PropertiesUtilsTest.java | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/commonjava/maven/ext/core/util/PropertiesUtils.java b/core/src/main/java/org/commonjava/maven/ext/core/util/PropertiesUtils.java index 48cd2a89..940750e1 100644 --- a/core/src/main/java/org/commonjava/maven/ext/core/util/PropertiesUtils.java +++ b/core/src/main/java/org/commonjava/maven/ext/core/util/PropertiesUtils.java @@ -205,12 +205,6 @@ private static PropertyUpdate internalUpdateProperty( ManipulationSession sessio // >${foo}value< // We don't attempt to recursively resolve those as tracking the split of the variables, combined // with the update and strict version checking becomes overly fragile. - if ( ignoreStrict ) - { - throw new ManipulationException( - "NYI : handling for versions with explicit overrides ({}) with multiple embedded properties is NYI. ", - oldValue ); - } if ( resolvedValue.equals( newValue ) ) { logger.warn( "Nothing to update as original key {} value matches new value {}", key, newValue ); diff --git a/core/src/test/java/org/commonjava/maven/ext/core/util/PropertiesUtilsTest.java b/core/src/test/java/org/commonjava/maven/ext/core/util/PropertiesUtilsTest.java index 09621f73..b1e98e43 100644 --- a/core/src/test/java/org/commonjava/maven/ext/core/util/PropertiesUtilsTest.java +++ b/core/src/test/java/org/commonjava/maven/ext/core/util/PropertiesUtilsTest.java @@ -274,6 +274,12 @@ public void testUpdateNestedProperties4() throws Exception "3.18.2.redhat-00003" ), PropertiesUtils.PropertyUpdate.FOUND ); assertEquals( "${camel.major.minor}.2.redhat-00003", + pP.getModel().getProperties().getProperty( "camel.version" ) ); + + assertSame( updateProperties( session, pP, true, "camel.version", + "3.18.2.redhat-00004" ), + PropertiesUtils.PropertyUpdate.FOUND ); + assertEquals( "${camel.major.minor}.2.redhat-00004", pP.getModel().getProperties().getProperty( "camel.version" ) ); assertSame( updateProperties( session, pP, false, "camel.version.2",