我在这里按照春季教程进行操作:https://spring.io/guides/gs/rest-service/并使其起作用。然后,我遵循了有关连接到MySQL数据库的教程,并在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的依赖项:

mysql - 我如何使用boxfuse来检测我正在使用gradle的spring应用程序使用MySQL数据库?-LMLPHP

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

最佳答案

如果您的应用先前是在db.type设置为none的情况下创建的,那么您将需要销毁并重新创建它以再次触发自动检测并更改数据库类型。为此,请转到您的项目目录并发出

$ boxfuse destroy$ gradle build$ boxfuse create

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

关于mysql - 我如何使用boxfuse来检测我正在使用gradle的spring应用程序使用MySQL数据库?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40471222/

10-16 02:12