简体   繁体   English

使用Jenkins和Windows Slave进行Cygpath故障排除

[英]Cygpath troubleshooting with Jenkins and Windows slave

I have a remote Windows computer with Cygwin 1.7.35 installed on it and we use it as a slave for CI testing with Jenkins. 我有一台安装了Cygwin 1.7.35的远程Windows计算机,我们将其用作从Jenkins进行CI测试的从属计算机。

I created a Jenkins job to build a Maven project (after cloning from repository). 我创建了一个Jenkins作业来构建Maven项目(从存储库克隆后)。

The Jenkins contains Cygpath 1.5 plugin and the registry path to Cygwin is SOFTWARE/Cygwin/Setup Jenkins包含Cygpath 1.5插件,Cygwin的注册表路径为SOFTWARE / Cygwin / Setup

I use a PreStep to clone the project from a repository: 我使用PreStep从存储库克隆项目:

source ~/.profile > /dev/null
cd /cygdrive/c
rm -rf .$WORKSPACE/project-name
hg clone something something

The repository clone works fine. 存储库克隆工作正常。 The build fails and I get this error in the console output: 构建失败,我在控制台输出中收到此错误:

ERROR: Failed to parse POMs
    hudson.util.IOException2: Failed to locate Cygwin installation. Is Cygwin installed?    
    at hudson.plugins.cygpath.CygpathLauncherDecorator$GetCygpathTask.getCygwinRoot(CygpathLauncherDecorator.java:138)
    etc...

I tried rewriting the Path variable from C:\\cygwin64\\bin to C:/cygwin64/bin and back. 我尝试将Path变量从C:\\ cygwin64 \\ bin重写为C:/ cygwin64 / bin并返回。 I tried this on Cygwin 1.7.32 first and then on 1.7.35 again. 我先在Cygwin 1.7.32上尝试过,然后再在1.7.35上尝试过。 I tried changing the path in the registry entry from C:\\Cygwin64 to C:Cygwin64\\bin and back. 我尝试将注册表项中的路径从C:\\ Cygwin64更改为C:Cygwin64 \\ bin并返回。 Nothing works. 什么都没有。

My colleague builds his project on the same Jenkins server with the same slave, but he is using an Ant project with build.xml and it works just fine. 我的同事在具有相同从属的同一Jenkins服务器上构建他的项目,但是他正在将一个Ant项目与build.xml一起使用,并且工作正常。

Please, do you have any suggestions on how to solve this? 请,您对如何解决此问题有任何建议吗?

Thanks! 谢谢!

Peter 彼得

I found an answer. 我找到了答案。

I created a new registry entry under 我在下面创建了一个新的注册表项

SOFTWARE\\Cygnus Solutions\\Cygwin\\ string rootdir aiming to cygwin64. 面向cygwin64的SOFTWARE \\ Cygnus Solutions \\ Cygwin \\字符串rootdir。

Which is strange, because in my Jenkins I use cygpath 1.5 which should find the correct path of Cygwin installation which is under registry path SOFTWARE\\Cygwin\\setup. 这很奇怪,因为在我的Jenkins中,我使用cygpath 1.5,它应该找到Cygwin安装的正确路径,该路径位于注册表路径SOFTWARE \\ Cygwin \\ setup下。

I also had to change the Jenkins slave machine configuration, because the slave machine Java SDK version is different than Java SDK version in global Jenkins settings. 我还必须更改Jenkins从机配置,因为从机Java SDK版本与全局Jenkins设置中的Java SDK版本不同。

I hope that someone finds this helpful! 我希望有人觉得这有帮助! Peter 彼得

I looked in the source code of the file which threw the exception and found out that it wants a string from the key 我查看了引发异常的文件的源代码,发现它需要键中的字符串

' HKLM/SOFTWARE/Wow6432Node/Cygwin/setup ' ' HKLM /软件/ Wow6432Node / Cygwin / setup '

named ' rootdir ' which has the absolute path to your Cygwin installation. 名为“ rootdir ”,它具有您Cygwin安装的绝对路径。

Edit: I ended up creating the key 'setup' because it didn't exist. 编辑:我最终创建了关键的“设置”,因为它不存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM