解决Maven中的依赖冲突

huangapple go评论108阅读模式
英文:

Resolving dependency conflicts in maven

问题

运行mvn enforcer:enforce时,我收到以下错误信息:

对于 commons-lang:commons-lang:2.4,依赖汇聚错误的路径是:

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-com.atlassian.event:atlassian-event:2.2.0
      +-commons-lang:commons-lang:2.4
和

+-com.zapr.zaprutils:database-connections:1.20
  +-commons-configuration:commons-configuration:1.10
    +-commons-lang:commons-lang:2.6

[警告]
对于 org.apache.httpcomponents:httpcore:4.2.2,依赖汇聚错误的路径是:

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-org.apache.httpcomponents:httpcore:4.2.2
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-org.apache.httpcomponents:httpcore-nio:4.2.2
      +-org.apache.httpcomponents:httpcore:4.2.2
和

+-com.amazonaws:aws-java-sdk-ssm:1.11.833
  +-com.amazonaws:aws-java-sdk-core:1.11.833
    +-org.apache.httpcomponents:httpclient:4.5.5
      +-org.apache.httpcomponents:httpcore:4.4.9

[警告]
对于 com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9,依赖汇聚错误的路径是:

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
    +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-api:0.13.2
      +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-com.atlassian.event:atlassian-event:2.2.0
      +-com.atlassian.util.concurrent:atlassian-util-concurrent:0.0.12
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9

[警告]
对于 commons-logging:commons-logging:1.1.1,依赖汇聚错误的路径是:

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-org.apache.httpcomponents:httpclient-cache:4.2.1-atlassian-2
      +-commons-logging:commons-logging:1.1.1
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-org.apache.httpcomponents:httpasyncclient:4.0-beta3-atlassian-1
      +-commons-logging:commons-logging:1.1.1
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
    +-org.springframework:spring-context:4.2.4.RELEASE
      +-org.springframework:spring-core:4.2.4.RELEASE
        +-commons-logging:commons-logging:1.2
和

+-com.atlassian.jira:jira-rest-java-client-core:3.0.0
  +-org.apache.httpcomponents:httpmime:4.1.2
    +-commons-logging:commons-logging:1.1.1
和

+-com.amazonaws:aws-java-sdk-ssm:1.11.833
  +-com.amazonaws:aws-java-sdk-core:1.11.833
    +-commons-logging:commons-logging:1.1.3
和

+-com.zapr.zaprutils:database-connections:1.20
  +-commons-configuration:commons-configuration:1.10
    +-commons-logging:commons-logging:1.1.1

当我从我的pom.xml中删除以下依赖项时,代码构建正常。

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-core</artifactId>
    <version>5.2.1</version>
</dependency>

但是,当我保留这个依赖项构建时,我收到以下错误。

Caused by: java.lang.NullPointerException
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.setConfiguration(AbstractJAXBProvider.java:105)
	...

我应该如何修复这个问题?我尝试使用不同版本的 jira-rest-java-client-core,但结果都相同。我已经阅读了关于排除依赖项的信息,但不确定如何使用它们来解决我的问题。

英文:

On running mvn enforcer:enforce I get the following

   `Dependency convergence error for commons-lang:commons-lang:2.4 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-com.atlassian.event:atlassian-event:2.2.0
        +-commons-lang:commons-lang:2.4
and

  +-com.zapr.zaprutils:database-connections:1.20
    +-commons-configuration:commons-configuration:1.10
      +-commons-lang:commons-lang:2.6

[WARNING] 
Dependency convergence error for org.apache.httpcomponents:httpcore:4.2.2 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpcore:4.2.2
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpcore-nio:4.2.2
        +-org.apache.httpcomponents:httpcore:4.2.2
and

  +-com.amazonaws:aws-java-sdk-ssm:1.11.833
    +-com.amazonaws:aws-java-sdk-core:1.11.833
      +-org.apache.httpcomponents:httpclient:4.5.5
        +-org.apache.httpcomponents:httpcore:4.4.9

[WARNING] 
Dependency convergence error for com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
      +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
      +-com.atlassian.httpclient:atlassian-httpclient-api:0.13.2
        +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-com.atlassian.event:atlassian-event:2.2.0
        +-com.atlassian.util.concurrent:atlassian-util-concurrent:0.0.12
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9

[WARNING] 
Dependency convergence error for commons-logging:commons-logging:1.1.1 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpclient-cache:4.2.1-atlassian-2
        +-commons-logging:commons-logging:1.1.1
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpasyncclient:4.0-beta3-atlassian-1
        +-commons-logging:commons-logging:1.1.1
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.springframework:spring-context:4.2.4.RELEASE
        +-org.springframework:spring-core:4.2.4.RELEASE
          +-commons-logging:commons-logging:1.2
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-org.apache.httpcomponents:httpmime:4.1.2
      +-commons-logging:commons-logging:1.1.1
and

  +-com.amazonaws:aws-java-sdk-ssm:1.11.833
    +-com.amazonaws:aws-java-sdk-core:1.11.833
      +-commons-logging:commons-logging:1.1.3
and

  +-com.zapr.zaprutils:database-connections:1.20
    +-commons-configuration:commons-configuration:1.10
      +-commons-logging:commons-logging:1.1.1

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for commons-lang:commons-lang:2.4 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-com.atlassian.event:atlassian-event:2.2.0
        +-commons-lang:commons-lang:2.4
and

  +-com.zapr.zaprutils:database-connections:1.20
    +-commons-configuration:commons-configuration:1.10
      +-commons-lang:commons-lang:2.6
, 
Dependency convergence error for org.apache.httpcomponents:httpcore:4.2.2 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpcore:4.2.2
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpcore-nio:4.2.2
        +-org.apache.httpcomponents:httpcore:4.2.2
and

  +-com.amazonaws:aws-java-sdk-ssm:1.11.833
    +-com.amazonaws:aws-java-sdk-core:1.11.833
      +-org.apache.httpcomponents:httpclient:4.5.5
        +-org.apache.httpcomponents:httpcore:4.4.9
, 
Dependency convergence error for com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
      +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.jira:jira-rest-java-client-api:3.0.0
      +-com.atlassian.httpclient:atlassian-httpclient-api:0.13.2
        +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-com.atlassian.event:atlassian-event:2.2.0
        +-com.atlassian.util.concurrent:atlassian-util-concurrent:0.0.12
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.util.concurrent:atlassian-util-concurrent:2.4.0-M9
, 
Dependency convergence error for commons-logging:commons-logging:1.1.1 paths to dependency are:

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpclient-cache:4.2.1-atlassian-2
        +-commons-logging:commons-logging:1.1.1
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.apache.httpcomponents:httpasyncclient:4.0-beta3-atlassian-1
        +-commons-logging:commons-logging:1.1.1
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:0.13.2
      +-org.springframework:spring-context:4.2.4.RELEASE
        +-org.springframework:spring-core:4.2.4.RELEASE
          +-commons-logging:commons-logging:1.2
and

  +-com.atlassian.jira:jira-rest-java-client-core:3.0.0
    +-org.apache.httpcomponents:httpmime:4.1.2
      +-commons-logging:commons-logging:1.1.1
and

  +-com.amazonaws:aws-java-sdk-ssm:1.11.833
    +-com.amazonaws:aws-java-sdk-core:1.11.833
      +-commons-logging:commons-logging:1.1.3
and

  +-com.zapr.zaprutils:database-connections:1.20
    +-commons-configuration:commons-configuration:1.10
      +-commons-logging:commons-logging:1.1.1
]`

When I remove the following dependency from my pom.xml the code builds fine.

&lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
            &lt;artifactId&gt;jira-rest-java-client-core&lt;/artifactId&gt;
            &lt;version&gt;5.2.1&lt;/version&gt;
&lt;/dependency&gt;

But when I build keeping this dependency I get the following error.

Caused by: java.lang.NullPointerException
at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.setConfiguration(AbstractJAXBProvider.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1287)
at org.jvnet.hk2.internal.ClazzCreator.methodMe(ClazzCreator.java:319)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:372)
... 89 more
javax.servlet.ServletException: io.dropwizard.jersey.setup.JerseyServletContainer-1c62c3fd@987f3da==io.dropwizard.jersey.setup.JerseyServletContainer,jsp=null,order=1,inst=false
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:691)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:427)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:374)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:848)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:101)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:403)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:252)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:419)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:386)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:93)
at com.zapr.api.sdkrules.SDKRulesAPIApplication.main(SDKRulesAPIApplication.java:24)
Caused by: A MultiException has 3 exceptions.  They are:
1. java.lang.NullPointerException
2. java.lang.IllegalStateException: Unable to perform operation: method inject on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
3. java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.message.internal.MessageBodyFactory
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:392)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:70)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:88)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:58)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:54)
at jersey.repackaged.com.google.common.collect.Iterators$8.transform(Iterators.java:799)
at jersey.repackaged.com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
at java.util.LinkedHashSet.&lt;init&gt;(LinkedHashSet.java:169)
at jersey.repackaged.com.google.common.collect.Sets.newLinkedHashSet(Sets.java:325)
at org.glassfish.jersey.internal.inject.Providers.getClasses(Providers.java:392)
at org.glassfish.jersey.internal.inject.Providers.getProviders(Providers.java:188)
at org.glassfish.jersey.message.internal.MessageBodyFactory.&lt;init&gt;(MessageBodyFactory.java:222)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375)
at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:272)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:366)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:83)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:71)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154)
at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:122)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:774)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:737)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:707)
at org.glassfish.jersey.server.model.ComponentModelValidator.&lt;init&gt;(ComponentModelValidator.java:97)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:549)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)
at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347)
at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:670)
... 41 more

How do I fix this? I tried using different versions of jira-rest-java-client-core but result is the same. I have read about exclusions but not sure how to use them to solve my problem.

答案1

得分: 1

依赖收敛错误通过在<dependencyManagement>中使用条目来进行修复,而不是通过使用排除项来修复。

你需要执行以下步骤:

  • 你查看哪些传递性依赖出现在多个版本中。
  • 你选择你想要的版本(通常是最新版本)。
  • 你在你的POM的<dependencyManagement>部分中添加一个条目,指定这个版本。
  • 这个条目将会覆盖不同的传递性依赖。
英文:

Dependency convergence errors are fixed by using entries in &lt;dependencyManagement&gt;, not by using exclusions.

You do the following:

  • You look into the list which transitive dependencies appear in more than one version.
  • You pick the version you want (often the newest).
  • You add an entry to the &lt;dependencyManagement&gt; section of your POM in which specify this version.
  • This entry will then override the different transitive dependencies.

答案2

得分: 1

问题出在传递性依赖上,您可以通过将冲突的依赖项移动到 dependencyManagement 中来解决。

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-core</artifactId>
            <version>5.2.1</version>
        </dependency>
    </dependencies>
</dependencyManagement>

然后在依赖部分定义依赖项,而不需要指定任何版本。

<dependencies>
    <dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-rest-java-client-core</artifactId>
    </dependency>
</dependencies>
英文:

The issue is with transitive dependencies, you can fix it by moving the conflicting dependency in a dependencyManagement

&lt;dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
&lt;artifactId&gt;jira-rest-java-client-core&lt;/artifactId&gt;
&lt;version&gt;5.2.1&lt;/version&gt;
&lt;dependency&gt;
&lt;dependencies&gt;
&lt;dependencyManagement&gt;

And then define dependency in the dependencies section without any version

&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
&lt;artifactId&gt;jira-rest-java-client-core&lt;/artifactId&gt;
&lt;dependency&gt;
&lt;dependencies&gt;

huangapple
  • 本文由 发表于 2020年9月17日 20:46:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/63938349.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定