启动我的应用程序时,Spring Security 在我的 h2 数据库中创建两个表“用户”和“权限”。我的问题是,当我第二次启动应用程序时,数据库已经填充了这两个表,但是 Spring Security 直到想要创建它们。如果表不存在,我如何告诉 Spring Secutiry 仅创建表?或者我应该改变其他东西来解决这个问题?
Spring Secutiry 正在创建我从博客中获得的两个表,这些表描述了我查看过的一些代码。它说:“关于数据模型的一些说明。用户表中没有存储真实的用户名和密码。该表是由 Spring Security 定义的,用于通用用途,而不是特定于社交登录用例。”
我得到的错误消息,一些 java 堆栈跟踪,是:
Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource class path resource [org/springframework/security/core/userdetails/jdbc/users.ddl]:
create table users(username varchar_ignorecase(50) not null primary key,password varchar_ignorecase(500) not null,enabled boolean not null); nested exception is org.h2.jdbc.JdbcSQLException: Table "USERS" already exists;
SQL statement: create table users(username varchar_ignorecase(50) not null primary key,password varchar_ignorecase(500) not null,enabled boolean not null) [42101-175]
Run Code Online (Sandbox Code Playgroud)
和
Caused …Run Code Online (Sandbox Code Playgroud) 我正在运行 Sonarqube 5.3 并将其与 Jenkins 集成。我想将 Sonareqube 问题作为 Gerrit 评论发布。
然后我需要指定从sonarqube生成的数据的路径和名称,例如build/sonar/sonar-report.json
文件 sonar-report.json 未生成,我发现 Sonarqube 的一些设置应该使 sonarqube 创建该文件。
sonar.report.export.path=sonar-report.json
sonar.issuesReport.html.enable=true
sonar.issuesReport.json.enable=true
sonar.issuesReport.console.enable=true
Run Code Online (Sandbox Code Playgroud)
我尝试在文件中设置这些
<sonar-installation-directory>/conf/sonar.properties
Run Code Online (Sandbox Code Playgroud)
我已经重新启动了 Sonare 服务并重新启动了计算机,但 sonar-report.json 文件仍然没有创建。