fsantiag / sonar-clojure

A SonarQube plugin to analyze Clojure source.
MIT License
58 stars 27 forks source link

Plugin fails to launch lein on Windows environment. #38

Closed unmeshtieto closed 3 years ago

unmeshtieto commented 4 years ago

Describe the bug Plugin fails to launch lein on Windows environment.

How to reproduce Steps to reproduce the behavior:

  1. Deploy plugin on SonarQube
  2. Run SonarQube Scanner

Expected behavior Scanner should work without error

Screenshots Scanner Error org.sonar.api.utils.command.CommandException: java.io.IOException: Cannot run program "lein": CreateProcess error=2, The system cannot find the file specified at org.sonar.api.utils.command.CommandExecutor.execute(CommandExecutor.java:102) at org.sonar.plugins.clojure.sensors.CommandRunner.run(CommandRunner.java:19) at org.sonar.plugins.clojure.sensors.eastwood.EastwoodSensor.execute(EastwoodSensor.java:50) at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45) at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88) at org.sonar.scanner.phases.SensorsExecutor.lambda$execute$1(SensorsExecutor.java:65)

Additional Note: I checked and lein is defined at "PATH" variable. I am able to run lein from command prompt without error

Additional context Add any other context about the problem here.

fsantiag commented 4 years ago

HI @unmeshtieto, thank you for your contribution. I am currently unable to debug this issue because I don't have a Windows machine. Few questions:

  1. Is the PATH set in the session running the scanner?
  2. Try to run lein eastwood in your project and see if it works (make sure to add the plugin first).
  3. How exactly you invoke lein on your project on Windows? Could you send me the exact command you type in the terminal?
  4. We just released a new version of the plugin, could you also try with the new version?
danieltsukiji commented 4 years ago

Ran in to the same issues on Windows. Should be fixed with this PR: https://github.com/fsantiag/sonar-clojure/pull/39

fsantiag commented 3 years ago

This issue has been fixed in the latest changes.