这些是在我的 pom.xml 文件中添加的与 spring 相关的 jar
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.2.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
我看到的错误是:
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.185 sec <<< FAILURE! - in com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests
emptyInputShouldReturnEmptyJson(com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests) Time elapsed: 1.145 sec <<< ERROR!
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/a-5594/dev/github/eps-jobs-air-offline-cancel-sync/target/classes/com/expedia/www/eps/jobs/air/offline/cancel/sync/dataaccess/WebNotifyManager.class]; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.emptyInputShouldReturnEmptyJson(LambdaTests.java:40)
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.emptyInputShouldReturnEmptyJson(LambdaTests.java:40)
Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.config.BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.emptyInputShouldReturnEmptyJson(LambdaTests.java:40)
sentenceShouldReturnFlatJsonWithWordsAndCounts(com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests) Time elapsed: 0.033 sec <<< ERROR!
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/a-5594/dev/github/eps-jobs-air-offline-cancel-sync/target/classes/com/expedia/www/eps/jobs/air/offline/cancel/sync/dataaccess/WebNotifyManager.class]; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.sentenceShouldReturnFlatJsonWithWordsAndCounts(LambdaTests.java:49)
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.sentenceShouldReturnFlatJsonWithWordsAndCounts(LambdaTests.java:49)
Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.config.BootstrapMode
at com.expedia.www.eps.jobs.air.offline.cancel.sync.LambdaTests.sentenceShouldReturnFlatJsonWithWordsAndCounts(LambdaTests.java:49)
我尝试在 pom.xml 中更改不同版本的 spring/jpa 等,但问题仍然存在。