我想将我的新项目升级到Spring Boot 2.1.0版,但我受限于Oracle 11数据库,它受到Flyway 4.2.0库的支持.一切都在Spring Boot 2.0.5版本上正常运行,但是当转到2.1.0版本时,我收到此错误:
java.lang.NoClassDefFoundError:
org/flywaydb/core/api/configuration/FluentConfiguration
Run Code Online (Sandbox Code Playgroud)
POM配置如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<ojdbc6.version>11.2.0.1</ojdbc6.version>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>${ojdbc6.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>4.2.0</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
我能够通过@Configuration(或者当然是添加到主类)解决问题,但问题是它的错误或功能?在2.1.0版之前,所有内容都是通过自动配置完成的,并且开箱即用.
@Bean(initMethod = "migrate")
Flyway flyway() {
Flyway flyway = new Flyway();
flyway.setBaselineOnMigrate(true);
flyway.setDataSource("jdbc:oracle:thin:@localhost:1521:xe", "USER", "PASSWORD1");
return flyway;
}
Run Code Online (Sandbox Code Playgroud) 我想从 SpringBoot Rest 服务在 Angular 应用程序中生成模型,为此我使用 ng-swagger-gen 插件。但不知何故,枚举仅作为内联字符串值生成,而不是作为 Enum 类生成,因此每次我必须自己键入字符串值或在 Typescript 中创建 Enum 对象时。
@Data
public class DummyClass {
private DummyEnum dummyEnum;
}
public enum DummyEnum {
One,
Two,
Three
}
Run Code Online (Sandbox Code Playgroud)
并且只生成 1 个代表模型的文件:
export interface DummyClass {
dummyEnum?: 'One' | 'Two' | 'Three';
}
Run Code Online (Sandbox Code Playgroud)
swagger 定义如下所示:
"definitions": {
"DummyClass": {
"type": "object",
"properties": {
"dummyEnum": {
"type": "string",
"enum": [
"One",
"Two",
"Three"
]
}
},
"title": "DummyClass"
}
}
Run Code Online (Sandbox Code Playgroud)
相反,当我手动将定义更改为此时,一切看起来都不错,生成了 2 个文件,1 个类和 1 …
我想问一下,如果有人知道,为什么REST ADMIN API请求中的用户详细信息中没有角色.我看到了一些涉及这个主题的帖子,但是没有明确的答案,或者他们建议使用keycloak-admin-client,但这似乎不太方便.也许我需要在管理控制台中映射角色或使用声明?角色是最重要的用户属性之一,因此它们没有被检索为其他用户属性的原因?有什么建议吗?谢谢
GET /auth/admin/realms/{realm}/users
{
"id": "efa7e6c0-139f-44d8-baa8-10822ed2a9c1",
"createdTimestamp": 1516707328588,
"username": "testuser",
"enabled": true,
"totp": false,
"emailVerified": false,
"firstName": "Test",
"lastName": "User",
"email": "test@xxx.com",
"attributes": {"xxx": ["123456"]},
"disableableCredentialTypes": ["password"],
"requiredActions": []
}
Run Code Online (Sandbox Code Playgroud) angular ×1
enums ×1
flyway ×1
java ×1
keycloak ×1
rest ×1
roles ×1
spring-boot ×1
swagger ×1
user-roles ×1