【发布时间】:2019-01-22 21:27:59
【问题描述】:
对于我的项目,我需要有一个特定的 jhipster 版本。
但我也想玩转所有新的 jhipster 功能(版本 5+)。
因此,我的想法是在 docker 容器中运行最新的 jhipster,这样就不会影响我的项目设置。
我关注了the offical jhipster install guide。
安装成功。
现在到了我被卡住的部分。
使用./gradlew test,所有测试都会失败。
我在两个目录中都尝试了./gradlwe test,这意味着一次在docker容器目录中(docker container exec -it jhipster bash --> 然后在应用程序文件夹中执行yarn install 然后./gradlew test)
以及从我安装卷的本地目录 (~/jhipster)。
我错过了什么?
对于任何有兴趣看到测试失败的人(这是所有测试的样子):
任务:测试
org.jhipster.health.web.rest.LogsResourceIntTest > changeLogs FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: io.jsonwebtoken.security.WeakKeyException
org.jhipster.health.web.rest.LogsResourceIntTest > getAllLogs FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: io.jsonwebtoken.security.WeakKeyException
org.jhipster.health.web.rest.LogsResourceIntTest > testLogstashAppender FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: io.jsonwebtoken.security.WeakKeyException
org.jhipster.health.web.rest.AccountResourceIntTest > testSaveInvalidEmail FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: io.jsonwebtoken.security.WeakKeyException
137 tests completed, 113 failed
> Task :test FAILED
FAILURE: Build failed with an exception.
【问题讨论】:
-
看起来问题是您的 JWT 秘密 base64 编码不够长(WeakKeyException)。它要么在 application*.yml 中配置,要么在环境变量中配置。见jhipster.tech/security/#jwt
-
这就是异常告诉我的,但对我来说,为什么在默认的 jhipster 配置中会发生这种情况是没有意义的。请参阅我的“答案”以了解更多困惑
标签: jhipster