gpt4 book ai didi

gradle - 如何使用Gradle修补Java文件?

转载 作者:行者123 更新时间:2023-12-03 03:56:01 25 4
gpt4 key购买 nike

我无法使用gradle修补文件。我尝试使用ant总是出现错误:

Execution failed for task ':rbps-api:compileJava'.
> java.io.IOException: Cannot run program "patch" (in directory "C:\Users\IdeaProjects\cosmos\rbps-api"): CreateProcess error=2, The system cannot find the file specified

gradle调试
11:31:46.535 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file 'C:\Users\oleh.havryliv\IdeaProjects\cosmos\rbps-api\build.gradle' line: 56
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':rbps-api:assemble'.
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.io.IOException: Cannot run program "patch" (in directory "C:\Users\oleh.havryliv\IdeaProjects\cosmos\rbps-api"): CreateProcess error=2, The system cannot find the file specified
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
11:31:46.539 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 5s

gradle.xml
apply plugin: 'java'

compileJava.doLast {
ant.patch(patchfile: "$rootDir\\rbps-api\\ResourceBundle.patch" , originalFile: "$rootDir\\rbps-api\\src\\main\\java\\com\\medtronic\\diabetes\\carelink\\rbps\\api\\resource\\ResourceBundle.java")
}

这些路径上存在文件。有什么事吗也许存在另一种方法?

最佳答案

正如Jeff Holt在评论中已经提到的那样:patch Ant任务“要求patch在执行路径上”(参见Ant docs)。

关于gradle - 如何使用Gradle修补Java文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59774294/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com