我正在学习本教程:Spring HATEOAS - Basic Example
我有一个spring boot项目,它有以下依赖项:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-data-rest</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
</dependencies>本教程展示了Spring HATEOAS提供的SimpleIdentifiableResourceAssembler作为执行转换的最简单机制。
问题是我无法从org.springframework.hateoas包中解析类"SimpleIdentifiableResourceAssembler“..它抛出一个SimpleIdentifiableResourceAssembler cannot be resolved to a type
发布于 2018-09-05 23:30:57
尽管有点晚了,但对于未来(和困惑的)开发人员来说:答案很简单,类
SimpleIdentifiableResourceAssembler
到目前为止还没有添加到回购中。您必须自己实现该功能(请参阅Github issue for this question)
发布于 2018-02-26 19:41:06
HATEOAS依赖项添加到:

但这并不能解决问题。
发布于 2018-02-26 01:43:58
您的项目中没有HATEOAS依赖项。
添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>https://stackoverflow.com/questions/48976349
复制相似问题