首页 > 解决方案 > ./gradlew 测试失败,出现 netty WebSocketException

问题描述

在 karate-demo 包中运行 ./gradlew 测试时出现 websocket 异常

它在 ubuntu 中

debasis:~/project/api/karate/karate/karate-demo$ /gradlew test bash: /gradlew: No such file or directory dev@debasis:~/project/api/karate/karate/karate-demo$ ./gradlew测试

任务:compileTestJava /home/dev/project/api/karate/karate/karate-demo/src/test/java/demo/websocket/WebSocketClientRunner.java:5:错误:找不到符号导入com.intuit.karate.netty。 WebSocket选项;^ 符号:类 WebSocketOptions 位置:包 com.intuit.karate.netty 1 错误

FAILURE:构建失败并出现异常。

4 秒内构建失败 3 个可操作的任务:1 个已执行,2 个是最新的

即使在 mavan/gradle 中没有构建错误,import 语句也无法解析类 WebSocketException

标签: karate

解决方案


I had the same issue after cloning the github repository (master).

Resolved the same by running ./gradlew test from the parent directory since the dependencies of the karate-demo are built from the parent using the version 1.0.0 which is not yet published.


推荐阅读