[ 
https://issues.apache.org/jira/browse/MNG-7270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422682#comment-17422682
 ] 

Jonathan Dowland edited comment on MNG-7270 at 9/30/21, 10:24 AM:
------------------------------------------------------------------

The binary itself is tiny, yes; but the savings are cumulative with everything 
else shaved off. Installing which on top of an image which doesn't have it can 
cost 17-20MiB due to package overhead and package manager metadata changes. 
([https://github.com/quarkusio/quarkus-buildpacks/pull/14#issuecomment-927834729).]

It's not installed by default in Red Hat Universal Base Images, and Debian have 
just moved it out of the "Essential" package set. So besides the space saving 
aspect, it's going to become less likely to be available. Distribution packages 
will start having to add an explicit dependency on "which" to their maven 
packages.


was (Author: jmtd):
The binary itself is tiny, yes; but the savings are cumulative with everything 
else shaved off. Installing which on top of an image which doesn't have it can 
cost 17-20MiB due to package overhead and package manager metadata changes. 
([https://github.com/quarkusio/quarkus-buildpacks/pull/14#issuecomment-927834729).]

It's not installed by default in Red Hat Universal Base Images, and Debian have 
just moved it out of the "Essential" package set. So besides the space saving 
aspect, it's going to become less likely to be available. Distribution packages 
will start having to add an explicit dependency on "which" to the maven package.

> Maven startup script (init) calls which(1) which is an external command
> -----------------------------------------------------------------------
>
>                 Key: MNG-7270
>                 URL: https://issues.apache.org/jira/browse/MNG-7270
>             Project: Maven
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 3.8.2
>         Environment: UNIX/POSIX, Linux
>            Reporter: Jonathan Dowland
>            Priority: Minor
>             Fix For: 4.0.x-candidate, 3.8.x-candidate
>
>
> The "init" shell wrapper script, that often ends up as /usr/bin/mvn in 
> downstream distributions, calls the program "which" in the situation where 
> JAVA_HOME is not defined.
> "which" is a separate binary program that may or may not be installed. 
> Increasingly it may not be in environments which are trying to reduce their 
> install footprint e.g. containers.
> A portable alternative is to use {{command \-v}} with some defensive commands 
> prior (unalias, unset: see 
> [https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html).]--
> I've got a PR ready to go.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to