英文:
How to handle run time errors of java in jenkins during gradle buiild or somewhere else?
问题
有时候当我执行Gradle构建以生成JAR文件时,
gradle clean build -x Test
它会通过(编译时),但在运行生成JAR时会失败(运行时错误)。
是否有任何方式可以在Jenkins中处理,以便如果在运行时将要抛出错误,我们可以使构建失败。
我正在考虑的一个解决方案是运行测试用例,而不是将其排除,因为它会加载上下文。不确定是否有效。
是否有任何最佳解决方案?
英文:
Sometimes when I do Gradle build to generate JARs,
gradle clean build -x Test
It passes (compile time), but while running generate JAR, it fails (runtime error)
Is there any way that can be handled in Jenkins so that if it is going to throw errors while running we can fail the build.
One solution I am thinking of is running the test case, not to exclude it as it will load context. Not sure if it works.
Is there any optimal solution?
专注分享java语言的经验与见解,让所有开发者获益!
评论