jarviz icon indicating copy to clipboard operation
jarviz copied to clipboard

Running jarviz cli under windows does not work due to command invocation

Open jbracker opened this issue 4 years ago • 1 comments

Describe the bug When I try to execute the quickstart guide under windows (via the mingw git bash) the .\jarviz produces the following error:

java.io.IOException: Cannot run program "mvn": CreateProcess error=2, The system cannot find the file specified

To Reproduce Just follow the quickstart guide under windows.

  • Jarviz version: 0.1.7
  • Java version: 1.8.0

Expected behavior It should just run and produce the HTML file.

Fix This error is due to the window enviroment. I can fix the issue by

  • replacing "mvn ... in com.vrbo.jarviz.service.MavenArtifactDiscoveryService.java with "mvn.cmd ... and then
  • recompiling and installing locally.

This appears to be a known issue with maven:

  • https://stackoverflow.com/questions/9674220/running-maven-from-java-code-in-windows
  • https://stackoverflow.com/questions/5141788/how-to-run-maven-from-java

Maybe you could use maven-embedder or maven-invoker. It would be nice if there were at least a code switch that selects the correct command depending on the operating system.

jbracker avatar Aug 24 '21 11:08 jbracker

@jbracker I have not tested this for Windows. If yo can send me a PR with your proposed changed, I am happy to merge it 🙂

lasanthak avatar Feb 08 '22 15:02 lasanthak