elasticpath / mvnmin

Builds only changed maven modules, speeding up your multi-module maven project builds.
Apache License 2.0
44 stars 0 forks source link

mvnmin does work with Windows #24

Closed ivanjensen-ep closed 1 year ago

ivanjensen-ep commented 1 year ago

Background

When attempting to use mvnmin Windows it fails to find the mvn executable.

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:453)
        at java.lang.ProcessImpl.start(ProcessImpl.java:139)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 10 more
Failed to execute 'mvn', either it couldn't be found, or it isn't executable.

Investigation showed that we are missing the .cmd extension on the executable name when executing on Windows.

Proposed Solution

The MavenDriver class should be enhanced to support Windows by automatically adding the .cmd extension when running on that OS.