Hiteshsai007 commented on issue #10115:
URL: https://github.com/apache/maven/issues/10115#issuecomment-4759029404
I've implemented this in #12332.
The solution adds an `executable(name_or_path)` function to Maven 4's
condition-based profile activation DSL (alongside the existing `exists()`,
`missing()`, `inrange()`, etc.).
**How it works:**
- If a plain name is given (e.g. `executable('musl-gcc')`), each directory
in the system `PATH` is searched in order
- On Windows, extensions `.exe`, `.cmd`, `.bat`, `.com` are tried
automatically
when the name has none
- If an absolute/relative path is given (e.g.
`executable('/usr/bin/musl-gcc')`),
it is checked directly without PATH traversal
- The `PATH` is read from `ProfileActivationContext` system properties
(`env.PATH`) — consistent with how Maven exposes all env vars
The use case from the issue now works as:
```xml
<activation>
<condition>executable('x86_64-linux-musl-gcc')</condition>
</activation>
--
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]