Skip to content

[MWRAPPER-82] mvnw.cmd fails when run from a parent directory. #247

Description

@jira-importer

Christopher Holt opened MWRAPPER-82 and commented

running "c:\project\module\mvn.cmd" from "c:\project" will fail like this:

 
The system cannot find the file C:\project.mvn\wrapper\maven-wrapper.properties
 

It should look in c:\project\module, not c:\project for the .mvn folder. 

 

This works fine with the mvnw sh script under linux.

 

Under liniux, the sh script starts from "dirname $0" looking for .mvn.  The cmd script starts from "%CD%".  wrapping this line:

 
set EXEC_DIR=%CD%
 
with pushd/popd calls fixes the problem.
 
i.e:
 
pushd %~dp0
set EXEC_DIR=%CD%
popd
 
Since this script is created and added to version control for the project, the workaround is to simply fix the generated scipt.
 
 


Issue Links:

  • CAMEL-21662 Camel JBang - run with Spring boot / Quarkus fails on Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:minorMinor loss of function, or other problem where easy workaround is present

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions