英文:
Unable to mark a Contract as inProgress() with Spring Cloud Contract
问题
我们需要将我们的一个合同临时标记为 inProgress()。
这是我尝试的方式:
Contract.make {
inProgress()
description "应该执行某项操作"
request {
// 在这里定义请求
}
response {
// 在这里定义响应
}
}
没有 "inProgress()" 这一行,一切都构建并正常运行,但是有它时,尝试运行 contractTest gradle 任务时会出现以下错误:
Spring Cloud Contract Verifier Plugin 异常: 进程 'command 'C:\path\to\jdk\bin\java.exe'' 完成时退出值为非零
令人沮丧的是,堆栈跟踪或日志未提供实际错误的任何详细信息。如何调试此问题的任何想法都将不胜感激。
spring-cloud-contract-dependencies 版本为 4.0.1。
英文:
We need to temporary mark one of our Contracts as inProgress().
Here's how I try to do it:
Contract.make {
inProgress()
description "should do a thing"
request {
//request definition here
}
response {
//response definition here
}
Without the "inProgress()" line everything builds and runs ok, but with it I get this error when trying to run contractTest gradle task.
Spring Cloud Contract Verifier Plugin exception: Process 'command 'C:\path\to\jdk\bin\java.exe'' finished with non-zero exit value 1
Frustratingly enough, stacktrace or logs don't provide any details of what the actual error is. Any ideas on how to debug this are much appreciated.
spring-cloud-contract-dependencies version is 4.0.1
答案1
得分: 0
以下是翻译好的部分:
问题在于我错误地假设 failOnInProgress Gradle 插件属性默认设置为 false。由于文档中说:“您可以设置 failOnInProgress 的值[...] 以确保您的构建会中断...”,我认为不设置它将保证通过。
明确将该属性设置为 false 解决了这个问题。
英文:
The problem was that I incorrectly assumed that failOnInProgress gradle plugin property would be set to false by default. Since the docs said "You can set the value of the failOnInProgress [...] to ensure that your build will break..." it seemed to me that not setting it would guarantee a pass.
Setting the property to false explicitly fixed the issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论