无法识别的字段位于:数据库 Dropwizard/Java 8

Unrecognized field at: database Dropwizard/Java 8

我正在尝试使用 docker 到 运行 使用 dropwizard 和 mysql 数据库的服务器。我遵循了教程并相信添加了必要的文件,但我仍然收到以下错误。 https://www.dropwizard.io/0.7.1/docs/manual/jdbi.html。当试图 运行 docker-组合时。当我尝试 运行 我的终端中的以下内容时也会发生这种情况。 java -jar target/bitly-1.0-SNAPSHOT.jar server src/config.yml

server_1   | config.yml has an error:
server_1   |   * Unrecognized field at: database
server_1   |     Did you mean?:
server_1   |       - template
server_1   |       - metrics
server_1   |       - defaultName
server_1   |       - server
server_1   |       - logging
server_1   |

我已经解决了 Whosebug 上的大部分相关问题,但似乎无法弄清楚为什么我的 config.yml 文件中会出现此错误。

我这里有完整的回购协议。 https://github.com/Jazilch/bit.ly

有没有人有什么想法?

需要立即关注的问题是: https://github.com/Jazilch/bit.ly/blob/1b4f8e77acced6e054cced5bf4cdf51d2d7da2fc/server/pom.xml#L16-L29

    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>${dropwizard.version}</version>
    </dependency>
    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-db</artifactId>
        <version>0.8.2</version>
    </dependency>
    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-jdbi</artifactId>
        <version>0.7.0-rc1</version>

您正在使用各种 dropwizard 模块的几个不同版本。它们并不意味着可以互换。始终只使用一个。

你也可以删除关于 <artifactId>dropwizard-db</artifactId> 的依赖。 dropwizard-jdbi 正在声明并包含它:https://github.com/dropwizard/dropwizard/blob/3df1e0a621a2b6f1f559fa95029abe09ce41e093/dropwizard-jdbi/pom.xml#L29