设想情况是:
@JsonProperty,不能将字符串反序列化为LocalDateTime@JsonDeserialize(using=LocalDateTimeDeserializer.class)问题:无法将LocalDateTimeDeserializer导入到代码中的
下面是我的gradle依赖项部分:
dependencies {
compile ("org.springframework.social:spring-social-core:$springSocialVersion")
compile ("org.springframework.social:spring-social-config:$springSocialVersion")
compile ("org.springframework.social:spring-social-security:$springSocialVersion", optional)
compile ("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
compile ("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
compile ("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
compile ("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jsr310Version")
compile ("org.springframework.security:spring-security-crypto:$springSecurityCryptoVersion")
compile ("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
testCompile ("org.springframework:spring-test:$springVersion")
},我肯定这是个陷阱!在哪里?
非常感谢您的帮助!
发布于 2015-04-10 16:14:58
如果您无法从项目中的依赖项导入类,那么eclipse可能无法看到gradle管理的依赖关系。
要更好地集成基于gradle的项目,请使用Eclipse Integration Gradle插件(https://github.com/spring-projects/eclipse-integration-gradle,有关安装说明,请参阅README.md )。
要将项目“转换”为分级项目:
Gradle Project现在,要更新项目依赖项,请右键单击项目目录并运行Gradle -> Refresh Dependencies。
发布于 2015-04-05 12:55:34
好了解决了!
这个问题(显然)与类路径有关。我是Eclipse开发的新手,所以它每天对我来说越来越清楚它是如何工作的。
要解决类似的问题,请执行以下操作:
compile ("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.5.1")中gradle cleanEclipse && gradle eclipse在此之后,它发挥了神奇的作用:LocalDateTimeDeserializer在那里让我导入。
注:,我不喜欢我自己的方法,我认为这太古怪了,不可能是正确的,所以我会留下这个问题,以防任何人对这里发生的事情有更清楚的了解,得到一个更好的答案。
就像我要继续前进一样,应该为那些撞人的脑袋提供参考。
https://stackoverflow.com/questions/29448020
复制相似问题