在 Hudson 中检查(从 VSS)和构建 Maven 项目时出现问题
我是 Hudson 的新手,也许有人知道解决方案: 我正在尝试从Hudson中的VSS(安装了vss插件)中签出父pom,现在我得到了类强制转换异常:
FATAL: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
at scm.vss.VSSSCM.checkout(VSSSCM.java:227)
at hudson.model.AbstractProject.checkout(AbstractProject.java:664)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:260)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:234)
at hudson.model.Run.run(Run.java:793)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:205)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:88)
有问题的行在这里:
Build lastBuild = (Build)build.getPreviousBuild();
接口是否已更改? 有人知道解决方案吗?
I am new to Hudson, perhaps someone knows the solution:
I am trying to checkout the parent pom from the VSS in Hudson (vss plugin installed) and now I get class cast exception:
FATAL: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
at scm.vss.VSSSCM.checkout(VSSSCM.java:227)
at hudson.model.AbstractProject.checkout(AbstractProject.java:664)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:260)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:234)
at hudson.model.Run.run(Run.java:793)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:205)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:88)
The line in question is here:
Build lastBuild = (Build)build.getPreviousBuild();
Has the interface changed? Anyone knows the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来 Shashi 将此作为 Hudson 问题 2665 提交,该问题仍处于开放状态。
Looks like Shashi filed this as Hudson issue 2665 which remains open.
看起来这是那个版本的 Hudson 中的一个错误。 您是否尝试过稍旧或较新的版本? IIRC 他们提供非常频繁的稳定构建,几乎每晚......
Looks like it's a bug in that version of Hudson. Have you tried a slightly older or newer version? IIRC they provide very frequent stable builds, almost nightly...
我从来没有遇到过这种情况,但是在 hudson 中使用 Maven 项目时我遇到了其他问题,比如构建时的无限循环等等(我认为 Hudson 本身应该评估和避免)。 我的意思是这个功能还很年轻并且容易出错。
对于您的例外情况,我可以建议您将项目配置为自由式软件项目。 如果您在构建步骤中设置“执行 maven 顶级目标”选项,则将使用 Maven 构建项目,并且异常可能会消失。
当项目配置为 Maven 项目时,Hudson 自动执行的另一件事是在成功构建时触发依赖项目的构建,但是,您也可以使用“构建其他项目”功能手动配置它。
正如您所看到的,这是一个很小的配置价格,我强烈认为您的异常将会消失。
希望能帮助到你。
卡洛斯
I've never faced that situation, but I have faced other problems when using maven projects in hudson like infinite loops upon builds and so (that I think Hudson itself should evaluate and avoid). By this I mean that this feature is quitely young and error-prone.
Regarding at your exception, I can advise you to configure the project as a freestyle software project. If you set up the "Execute maven top-level targets" option on the build steps, the project will be built using Maven and probably the exception will dissapear.
The other thing that Hudson does automatically when a project is configured as a maven project is triggering builds for dependent project on successfull build, but, you also can configure it manually by using the "Build other projects" feature.
As you see, it's a little configuration price to pay and I strongly think that your exception will dissapear.
Hope it helps.
Carlos