在进行maven构建时,杰克逊依赖版本被覆盖了

时间:2014-09-25 09:52:05

标签: java maven jackson

我有一个完美的工作项目。我能够成功构建和部署。昨天作为开发的一部分,我必须在我的项目中为Jackson jars添加以下maven依赖项,之后mvn clean install开始失败。

 <dependency>
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-mapper-asl</artifactId>
       <version>1.5.3</version>
</dependency>
<dependency>
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-core-asl</artifactId>
       <version>1.5.3</version>
</dependency>

我收到的错误消息是

  

[错误]无法在项目compass_app上执行目标:无法执行   解决项目的依赖关系   com.XXXXX.services:compass_app:jar:1.0-SNAPSHOT:收集失败   在org.codehaus.jackson中依赖dencies:jackson-mapper-asl:jar:1.5.3 - &gt;   org.codehaus.jackson:jackson-core-asl:jar:1.9.13:无法读取   org.codehaus.jackson的工件描述符:jackson-core-asl:j   r:1.9.13:无法转移神器   org.codehaus.jackson:jackson-core-asl:pom:1.9.13 from / to m-all   (http://XXXX/archives/all):无法传输文件:   http://XXXX/archives/all/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.pom。   返回码为:500,ReasonPhrase:无法找到托管存储库   id的配置:npanXXXX-1.5.0-maestXXXX-33。 - &GT; [帮助1]

我担心的是,为什么版本1.9.13在我的项目中未指定任何内容时尝试下载

  1. 我的pom文件中只有一个杰克逊罐子的声明。
  2. 我尝试过做mvn -X clean install&gt; install.txt。
  3. 以下跟踪可能会有所帮助。

    [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <artifact default-value="${project.artifact}"/>
      <attachedArtifacts default-value="${project.attachedArtifacts}"/>
      <createChecksum default-value="false">${createChecksum}</createChecksum>
      <localRepository>${localRepository}</localRepository>
      <packaging default-value="${project.packaging}"/>
      <pomFile default-value="${project.file}"/>
      <updateReleaseInfo default-value="false">${updateReleaseInfo}</updateReleaseInfo>
    </configuration>
    

    例外是。

     org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project compass_app: Could not resolve dependencies for project com.XXXX.services:compass_app:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.codehaus.jackson:jackson-mapper-asl:jar:1.5.3 -> org.codehaus.jackson:jackson-core-asl:jar:1.9.13
            at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:220)
            at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
            at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:257)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
            at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.XXXX.services:compass_app:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.codehaus.jackson:jackson-mapper-asl:jar:1.5.3 -> org.codehaus.jackson:jackson-core-asl:jar:1.9.13
            at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:167)
            at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
            ... 22 more
    

    任何帮助都会非常有帮助。提前谢谢。

    参考文献: - 以下链接已被提及。 1. jersey and jackson maven dependency issues? 2. http://maven.apache.org/ref/3.1.1/xref/org/apache/maven/artifact/resolver/DebugResolutionListener.html(了解maven的代码和工作) 3. http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

1 个答案:

答案 0 :(得分:2)

  

我担心的是为什么版本1.9.13尝试下载时   我没有在我的项目中的任何地方指定它

请使用mvn dependency:tree(请参阅:documentation),以便您能够跟踪此版本的加载原因。

可能有点transitive dependency