0

我在这里遵循了春季教程:https ://spring.io/guides/gs/rest-service/并让它工作。然后我按照关于连接到 MySQL DB 的教程进行操作,并在 build.gradle 中添加了依赖项。boxfuse 似乎没有检测到它。

MacBook-Pro-2 ~/work/test/server (develop) $ boxfuse info
Boxfuse client v.1.22.2.1149
Copyright 2016 Boxfuse GmbH. All rights reserved.

Account: ...

Info about ... in the dev environment:

App Type    : Single Instance (Elastic IP)
App URL     : 
DB Type     : No database
Logs Type   : No centralized logging

在我的 build.gradle 文件中,我只有:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.1.RELEASE")
        classpath 'mysql:mysql-connector-java:5.1.16'
    }
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile('mysql:mysql-connector-java:5.1.16')
}

为了完成这项工作,我错过了一步吗?


编辑:我在http://start.spring.io/上使用启动项目工具尝试了“boxfuse info”,并选择了 JDBC 和 MySQL 的依赖项:

在此处输入图像描述

编译成 jar 并在 jar 所在的构建目录中运行 boxfuse。它仍然没有检测到数据库。

4

1 回答 1

0

如果您的应用程序之前是使用db.typeset to创建的,none那么您将需要销毁并重新创建它以再次触发自动检测并更改数据库类型。为此,请转到您的项目目录并发出

$ boxfuse destroy $ gradle build $ boxfuse create

Boxfuse 将在部署时正确选择 MySQL 驱动程序并在每个环境中自动配置数据库。

于 2016-11-08T08:54:16.513 回答