tkobayas commented on PR #6778:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6778#issuecomment-4808808602

   Note:
   ---
   ● Yes, look at line 21 of CiComputeBuildScopes.java:
        
     //JAVA 21
        
     This JBang directive forces JDK 21. Here's the chain:
        
     1. JBang sees //JAVA 21 → downloads and installs JDK 21 → runs the script 
with JDK 21
     2. The script spawns mvn validate via ProcessBuilder (line 202) which 
inherits JBang's environment — including JAVA_HOME pointing to JDK 21
     3. So mvn validate runs across the entire project with JDK 21, before the 
real JDK 17 build starts
   
     The ProcessBuilder at line 205 only explicitly sets MAVEN_OPTS — it does 
NOT pin JAVA_HOME back to the CI's Java 17. So the spawned mvn process inherits 
JBang's JDK 21 environment.
   
     The non-reproduction after your changes could be because:
     - The issue is intermittent (timing/cache-dependent)
     - Or the different set of changed files changes the affected module set 
enough to avoid the trigger
   
     Quickest way to confirm: change //JAVA 21 to //JAVA 17 in 
CiComputeBuildScopes.java and push with only the original 2-file change. If the 
failure disappears, that's the root cause. The permanent fix would
     either be:
     - Downgrade the JBang directive to //JAVA 17 (the script uses nothing Java 
21-specific)
     - Or have the ProcessBuilder explicitly set JAVA_HOME to the CI's original 
value before spawning mvn validate
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to