Issues with DropWizard Gradle build

不想你离开。 提交于 2019-12-25 01:05:01

问题


I imported a Dropwizard project into Intellij IDEA (using Gradle Wrapper from the project itself). Its working for others, but I end up in issue like this:

Here is the gist of gradle dependency.
https://gist.github.com/vineelya/d882bbd0885fafba785ca58f106dfc8b Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z

dependencies {
    compile (
            'io.dropwizard:dropwizard-core:' + dropwizardVersion,
            'io.dropwizard:dropwizard-hibernate:' + dropwizardVersion,
            'io.dropwizard:dropwizard-migrations:' + dropwizardVersion,
            'io.dropwizard:dropwizard-auth:' + dropwizardVersion,
            'io.dropwizard:dropwizard-assets:' + dropwizardVersion,
            'io.dropwizard:dropwizard-forms:'+ dropwizardVersion,

回答1:


You have two dependencies which are importing older versions of Jackson Core.

com.amazon.alexa:alexa-skills-kit:1.2
com.google.api-client:google-api-client:1.19.1

While Gradle should always pick up the latest version, this might be causing your error.
Therefore, exclude them using

implementation('com.amazon.alexa:alexa-skills-kit:1.2') {
   exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
}

implementation('com.google.api-client:google-api-client:1.19.1') {
   exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
}

Or, update them to a compatible, maybe the latest, version (e.g. see MavenCentral).

To force the resolution of a specific version, you can use

configurations.all {
    resolutionStrategy {
        force 'com.fasterxml.jackson.core:jackson-core:2.8.8'
    }
}


来源:https://stackoverflow.com/questions/55009341/issues-with-dropwizard-gradle-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!