You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Volkan Yazici (Jira)" <ji...@apache.org> on 2025/04/04 12:15:00 UTC

[jira] [Created] (MWRAPPER-161) Fails to run when executed using `sh`

Volkan Yazici created MWRAPPER-161:
--------------------------------------

             Summary: Fails to run when executed using `sh`
                 Key: MWRAPPER-161
                 URL: https://issues.apache.org/jira/browse/MWRAPPER-161
             Project: Maven Wrapper
          Issue Type: Bug
          Components: Maven Wrapper Scripts
    Affects Versions: 3.3.2
            Reporter: Volkan Yazici


Several projects don't allow executable files in their version control system due to platform compatibility concerns. For instance, OpenJDK doesn't allow executables to be committed in Git repositories[1]. Hence, Maven Wrapper should be runnable as an argument to `sh`, though it is not:

{code}
sh mvnw
mvnw: 109: cannot open mvnw/.mvn/wrapper/maven-wrapper.properties: No such file
{code}

due to the following line:

{code}
"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
{code}

I expect there to be more issues due to `$0` usage assuming the script is executed as an executable – did not check.
 
[1] See the `Executable files are not allowed (file: mvnw)` error generated by the Skara bot of OpenJDK in this PR attempting to integrate Maven Wrapper to JMH: https://github.com/openjdk/jmh/pull/154



--
This message was sent by Atlassian Jira
(v8.20.10#820010)