gnodet-bot commented on code in PR #13442:
URL: https://github.com/apache/maven/pull/13442#discussion_r4251944309


##########
pom.xml:
##########
@@ -978,6 +978,22 @@ under the License.
   </build>
 
   <profiles>
+    <profile>
+      <!-- palantir-java-format crashes on JDK 27 
(palantir/palantir-java-format#1786);
+           drop this profile once maven-parent ships a fixed release.
+           Activated by property, not <jdk>: the model builder tests build 
this POM in sessions
+           without java.version, where a <jdk> activation is an error. -->
+      <id>jdk27-skip-spotless</id>
+      <activation>
+        <property>

Review Comment:
   ⚠️ **Narrow match — won't cover JDK 28+.** `<value>27</value>` is an exact 
string comparison: on JDK 28 (or later, if palantir is still broken), 
`java.specification.version` will be `"28"` and this profile will silently not 
activate. The original `<jdk>[27,)</jdk>` was open-ended for exactly this 
reason.
   
   Use Maven 4's condition activator instead — it supports version ranges and 
does not go through the JDK activator path that errors in model builder 
sessions:
   
   ```suggestion
             <value>27</value>
   ```
   
   Replace the entire `<activation>` block with:
   ```xml
   <activation>
     <condition>inrange('${java.specification.version}', '[27,)')</condition>
   </activation>
   ```
   
   See `ConditionProfileActivatorTest` — it already tests 
`inrange(${java.version}, '[1.5,)')` with an open upper bound, and the 
condition activator reads from system properties directly, so it does not fail 
in sessions where the JDK activator has no `java.version` context.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to