I am trying to import a project from github into intellij and run into this stack trace:
Caused by:
java.io.IOException: cannot start the program "git": error = 2, there is no such file or the directory in common_c6b3s0xd8gl4x9r47zsnga1nq $ _run_closure12.doCall (/Users/jrengh/Documents/teri/common.gradle:97)
I often saw this problem on the Internet, and the general solution seems to be to make sure that the git executable is correctly specified in the "Path to git executable" field under "Settings"> "Version Control"> Git. I did this, checked the connection and received a successful message.
The problem is with this task method, which is called in a separate gradle file located in one of my dependencies between projects:
common.gradle
task buildInfo { def cmd = "git rev-parse --short HEAD" def proc = cmd.execute() project.ext.revision = proc.text.trim() cmd = "git show -s --format=%ct HEAD" proc = cmd.execute() project.ext.timestamp = proc.text.trim() }
Thus, intellij does not recognize "git" in the command that I am trying to execute above, although I have successfully downloaded the git executable. Does anyone have any helpful suggestions?
git intellij-idea gradle
codenoob22
source share