You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/09/16 13:47:55 UTC
(maven) branch fix/13084-sandbox-external-profile-activation created (now 95fefaf7e7)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch fix/13084-sandbox-external-profile-activation
in repository https://gitbox.apache.org/repos/asf/maven.git
at 95fefaf7e7 test: add symmetric system-property suppression test for compat stack
This branch includes the following new commits:
new 95fefaf7e7 test: add symmetric system-property suppression test for compat stack
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven) 01/01: test: add symmetric system-property suppression test for compat stack
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch fix/13084-sandbox-external-profile-activation
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 95fefaf7e7e55062dd205f3b5cbe774b142b1c58
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Sep 16 13:47:45 2026 +0000
test: add symmetric system-property suppression test for compat stack
Add testExternalModelSystemPropertySuppressesDefaultOnProfile to
ExternalModelProfileActivationTest to mirror the equivalent test in
DefaultModelBuilderTest (impl stack). Verifies that a system property
named 'skip.defaults' suppresses the default-on negated-property profile
(!skip.defaults) in external builds — system properties are platform
facts that pass through the sandbox unchanged.
---
.../building/ExternalModelProfileActivationTest.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/compat/maven-model-builder/src/test/java/org/apache/maven/model/building/ExternalModelProfileActivationTest.java b/compat/maven-model-builder/src/test/java/org/apache/maven/model/building/ExternalModelProfileActivationTest.java
index 5ae15fda7e..12304b26af 100644
--- a/compat/maven-model-builder/src/test/java/org/apache/maven/model/building/ExternalModelProfileActivationTest.java
+++ b/compat/maven-model-builder/src/test/java/org/apache/maven/model/building/ExternalModelProfileActivationTest.java
@@ -277,6 +277,21 @@ void testExternalModelNegatedPropertyDefaultOnIsPreserved() throws Exception {
"negated-property (default-on) profile must fire in external model build");
}
+ @Test
+ void testExternalModelSystemPropertySuppressesDefaultOnProfile() throws Exception {
+ // A system property named skip.defaults suppresses the default-on negated-property
+ // profile (!skip.defaults) even in external model builds. System properties are platform
+ // facts that pass through the sandbox unchanged, so the publisher's opt-out mechanism
+ // still works when the consumer sets it at the JVM level.
+ Properties sp = systemPropertiesWithTestValues();
+ sp.setProperty("skip.defaults", "true"); // system-level opt-out
+ Model model = build(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL, sp, new Properties());
+
+ assertNull(
+ model.getProperties().get("profile.negated.property"),
+ "negated-property (default-on) profile must be suppressed when system property 'skip.defaults' is set");
+ }
+
@Test
void testExternalModelJdkActivationIsPreserved() throws Exception {
// JDK activation is a platform fact and must fire in external builds.