两个Maven的依赖于最新的老版本冲突 [英] Two Maven Dependency for latest and old version conflicts
问题描述
现在用弹簧数据dynamoDB项目从这里,根据其<一个HREF =https://github.com/michaellavelle/spring-data-dynamodb/blob/master/pom.xml相对=nofollow> pom.xml中他们使用的 1.6.9.1 版 AWS-java的SDK ,但我需要使用AWS-java的SDK最新版本为我的项目使用它的某些功能来实现Amazon S3的了。如果我有它的依赖性,
Am using spring-data-dynamoDB project from here, as per its pom.xml they have used 1.6.9.1 version of aws-java-sdk, but I need to use latest version of aws-java-sdk for my project for using some of its features to implement Amazon s3 too. If I include its dependency,
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.7.9</version>
</dependency>
我得到一个异常,如下所示,
am getting an exception as follows,
12:51:25.298 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean '(inner bean)': [_relProvider]
12:51:25.307 [main] ERROR o.s.w.c.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar$Jackson2ModuleRegisteringBeanPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_halObjectMapper': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fasterxml.jackson.databind.ObjectMapper]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
.......
.......
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_halObjectMapper': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fasterxml.jackson.databind.ObjectMapper]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
.......
.......
我曾尝试排除如下,也是同样的结果,
I have tried exclusions as follows and also the same result,
<dependency>
<groupId>org.socialsignin</groupId>
<artifactId>spring-data-dynamodb</artifactId>
<version>1.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
</exclusion>
</exclusions>
</dependency>
是否有可能现在使用的AWS-java的SDK最新版本在我的项目?否则弹簧数据dynamoDB的pom.xml需要进行更新,如果是的话只有我能使用它还是什么? 感谢Michaellavelle为巨大的项目。它帮助我很多完成DynamoDB的部分。
Is it possible to use latest version of aws-java-sdk in my project now?? or else spring-data-dynamoDB pom.xml have to be updated if so only I am able to use it or what?? Thanks Michaellavelle for that tremendous project. It helps me alot for completing DynamoDB part.
推荐答案
谢谢你@ user944849。这个问题在AWS-java的SDK是较低版本的弹簧数据休息,webmvc和冲突吧,所以由AWS-java的SDK不包括杰克逊库建立正确的使用杰克逊库。解决方法我得到的是,
Thanks you @user944849. The problem is jackson libs used in aws-java-sdk which is lower version as of in spring-data-rest-webmvc and conflicts with it, so by excluding jackson libs from aws-java-sdk builds correct. Solution I got is,
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.7.9</version>
<exclusions>
<exclusion>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
我不能因为初期信誉后一个答案。这可能是为别人谁卡住像我有用。谢谢你。
I am unable to post an answer early because of reputation. This may be useful for others who stuck as like me. Thank you.
这篇关于两个Maven的依赖于最新的老版本冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!