Gradle关于插件在Windows上失败

时间:2014-01-30 10:01:55

标签: windows git plugins gradle

关于插件的gradle(http://evgeny-goldin.com/wiki/Gradle-about-plugin)在Windows上成功运行,但是在about文件中包含来自git的信息的命令失败。 gradlew正在GitBash中运行。示例输出:

$ ./gradlew about --info
Starting Build
Settings evaluated using settings file 'C:\Users\cfogelberg\repos\sharepoint-kea\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\cfogelberg\repos\sharepoint-kea\build.gradle'.
Included projects: [root project 'sharepoint-kea', project ':jproxy', project ':sharepoint-crawler']
Evaluating root project 'sharepoint-kea' using build file 'C:\Users\cfogelberg\repos\sharepoint-kea\build.gradle'.
Groovy [1.8.6], root project 'sharepoint-kea', plugin [com.github.goldin.plugins.gradle.about.AboutPlugin] is applied, added task 'about'.
Evaluating project ':jproxy' using build file 'C:\Users\cfogelberg\repos\jproxy\build.gradle'.
Evaluating project ':sharepoint-crawler' using build file 'C:\Users\cfogelberg\repos\sharepoint-crawler\build.gradle'.
All projects evaluated.
Selected primary task 'about'
Tasks to be executed: [task ':about']
:about
Task ':about' has not declared any outputs, assuming that it is out-of-date.
Generating 'about' in [C:\Users\cfogelberg\repos\sharepoint-kea\build\tmp\about\about.txt]
Running [git] with arguments [--version] in directory [C:\Users\cfogelberg\repos\sharepoint-kea]
Starting process 'command 'git''. Working directory: C:\Users\cfogelberg\repos\sharepoint-kea Command: git --version
An attempt to initialize for well behaving parent process finished.
Process 'command 'git'' finished with exit value -1 (state: FAILED)
Deleting [C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
:: loading settings :: url = jar:file:/C:/Users/cfogelberg/.gradle/wrapper/dists/ivy-gradle-dist-1.6.0.0/7llkkulot0dh33dgrrpuftkd2e/gradle-1.6/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
Deleting [C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
Running [rmdir] with arguments [/s, /q, C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
Starting process 'command 'rmdir''. Working directory: C:\Users\cfogelberg\repos\sharepoint-kea Command: rmdir /s /q C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt
Process 'command 'rmdir'' finished with exit value -1 (state: FAILED)
Running [del] with arguments [/f, /q, C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
Starting process 'command 'del''. Working directory: C:\Users\cfogelberg\repos\sharepoint-kea Command: del /f /q C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt
Process 'command 'del'' finished with exit value -1 (state: FAILED)
Failed to natively delete [C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
Failed to delete [C:\Users\cfogelberg\repos\sharepoint-kea\build\com.github.goldin.plugins.gradle.about.AboutHelper-dependencies.txt]
Adding 'about' to task ':jar'
Adding 'about' to task ':mainSourceJar'
Adding 'about' to task ':zip'
Adding 'about' to [C:\Users\cfogelberg\repos\sharepoint-kea\build\distributions\sharepoint-kea.zip!about.txt]
[ant:zip] Updating zip: C:\Users\cfogelberg\repos\sharepoint-kea\build\distributions\sharepoint-kea.zip
Adding 'about' to [C:\Users\cfogelberg\repos\sharepoint-kea\build\libs\sharepoint-kea-sources.jar!about.txt]
[ant:zip] Updating zip: C:\Users\cfogelberg\repos\sharepoint-kea\build\libs\sharepoint-kea-sources.jar
Adding 'about' to [C:\Users\cfogelberg\repos\sharepoint-kea\build\libs\sharepoint-kea.jar!about.txt]
[ant:zip] Updating zip: C:\Users\cfogelberg\repos\sharepoint-kea\build\libs\sharepoint-kea.jar
Adding 'about' to [C:\Users\cfogelberg\repos\sharepoint-kea\build\tmp\expandedArchives\org.jacoco.agent-0.6.2.201302030002-0.6.2.201302030002.jar_60b57fpgcpkj2tvu7ba9ktna6\jacocoagent.jar!about.txt]
[ant:zip] Updating zip: C:\Users\cfogelberg\repos\sharepoint-kea\build\tmp\expandedArchives\org.jacoco.agent-0.6.2.201302030002-0.6.2.201302030002.jar_60b57fpgcpkj2tvu7ba9ktna6\jacocoagent.jar

BUILD SUCCESSFUL

Total time: 13.174 secs

在about.txt中产生的结果:

===============================================================================
 SCM Info
===============================================================================
 Unsupported SCM system: either project is not managed by Git or command-line client is not available.
 Tried Git:
 ~~~~~~~~~~
 'git --version' returned []
===============================================================================

1 个答案:

答案 0 :(得分:0)

问题是由路径引起的。明确地将git添加到windows路径和gitbash路径并没有解决问题,但是将git.exelibiconv2.dll复制到git repo的根目录解决了它(一个可怕的黑客,窗口和路径......呃)。