gnodet opened a new pull request, #11489:
URL: https://github.com/apache/maven/pull/11489

   ## Description
   
   This PR fixes #11485 by replacing the non-POSIX-compliant `xargs -0` option 
with a pure shell solution that works on all POSIX-compliant systems including 
AIX, FreeBSD, and others.
   
   ## Problem
   
   The `xargs -0` option was introduced in commit aeff353bd4c9 to handle 
special characters (pipes, quotes, spaces) in `.mvn/jvm.config` files. However, 
this option is not part of the POSIX standard and is not available on AIX, 
FreeBSD, and other systems, causing the Maven wrapper to fail on these 
platforms.
   
   ## Solution
   
   The fix replaces `xargs -0` with a pure shell solution that:
   - Uses the `read` builtin with `-d ''` option to read NUL-terminated strings
   - Builds the result string incrementally in a while loop
   - Maintains the same functionality of handling special characters correctly
   - Works on all POSIX-compliant systems
   
   ## Changes
   
   - Modified `concat_lines()` function in 
`apache-maven/src/assembly/maven/bin/mvn`
   - Replaced the pipeline using `xargs -n 1 -0` with a while loop using `read 
-r -d ''`
   - Preserved all existing functionality for handling special characters
   
   ## Testing
   
   - All existing tests pass, including the integration test for pipes in 
MAVEN_OPTS (MavenITgh10937QuotedPipesInMavenOptsTest)
   - Manually tested the `concat_lines` function with special characters
   - Full build completed successfully with `mvn clean install`
   
   ## Compatibility
   
   This change maintains backward compatibility while extending support to more 
platforms. The behavior for handling special characters in `.mvn/jvm.config` 
remains unchanged.
   
   ---
   Pull Request opened by [Augment Code](https://www.augmentcode.com/) with 
guidance from the PR author


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