Running jarviz cli under windows does not work due to command invocation
jbracker opened this issue · 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 ...
incom.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 I have not tested this for Windows. If yo can send me a PR with your proposed changed, I am happy to merge it 🙂