无法在com.fasterxml.jackson.dataformat上收集依赖项:jackson-dataformat-xml:jar:2.8.1

时间:2018-03-12 14:14:59

标签: maven spring-boot

我们在构建系统中使用maven 3.3.3版本,而在本地系统中我们有maven 3.5.0版本。使用3.5.0版本的maven一切都很完美,它会下载所有的jar。但是对于maven 3.3.3,我们得到了以下错误:

[ERROR] Failed to collect dependencies at com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.8.1: Failed to read artifact descriptor for com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.8.1: Could not transfer artifact com.fasterxml.jackson.dataformat:jackson-dataformat-xml:pom:2.8.1 from/to central (http://build.dlh.de/artifactory/libs-release): Failed to transfer file: http://build.dlh.de/artifactory/libs-release/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.8.1/jackson-dataformat-xml-2.8.1.pom. Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project lhopenapi-actuators: Could not resolve dependencies for project xxx:xxx:jar:1.0.0: Failed to collect dependencies at com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.8.1
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
    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:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
    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.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    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 hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform(UserRequest.java:210)
    at hudson.remoting.UserRequest.perform(UserRequest.java:53)
    at hudson.remoting.Request$2.run(Request.java:364)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

请您帮忙解决以下问题:

  1. maven版本是否与其他应用程序罐相关?像maven 3.5.0版可以下载2.8.1版本的jackson-dataformat-xml和3.3.3无法下载?
  2. 如果有的话,我们如何管理这些依赖?
  3. 请帮助我们解决此问题。

    根据建议更新下面的其他信息:

    的pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <artifactId>lhopenapi-actuators</artifactId>
        <version>1.0.0</version>
        <name>Custom Actuators for Spring Boot</name>
        <parent>
            <groupId>com.sample</groupId>
            <artifactId>lhopenapi-common-properties</artifactId>
            <version>1.0.0</version>
        </parent>
        <properties>
            <sonar.issue.ignore.multicriteria>e1</sonar.issue.ignore.multicriteria>
            <sonar.issue.ignore.multicriteria.e1.ruleKey>squid:S00101</sonar.issue.ignore.multicriteria.e1.ruleKey>
            <sonar.issue.ignore.multicriteria.e1.resourceKey>**/*RS.java</sonar.issue.ignore.multicriteria.e1.resourceKey>
            <spring.version>4.3.11.RELEASE</spring.version>
            <jackson.version>2.8.1</jackson.version>
            <slf4j.version>1.7.19</slf4j.version>
            <javax.servlet.version>3.0.1</javax.servlet.version>
            <spring.boot.version>1.5.7.RELEASE</spring.boot.version>
            <lhopenapi.errors.version>1.0.0</lhopenapi.errors.version>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-actuator</artifactId>
                <version>${spring.boot.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>${javax.servlet.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    
    </project>
    

    另外一个信息是jackson-databind与除jackson-dataformat-xml之外的所有其他jar一起正确下载。我们正在使用jenkins来构建这个包。

    User Settings.xml:

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">
        <localRepository>C:\Users\anil\.m2\repository</localRepository>
        <interactiveMode />
        <usePluginRegistry />
        <offline>false</offline>
        <pluginGroups />
    
    
        <mirrors>
            <mirror>
                <id>central</id>
                <mirrorOf>*</mirrorOf>
                <url>http://repo1.maven.org/maven2/</url>
            </mirror>
        </mirrors>
        <profiles>
            <profile>
                <id>nexus</id>
                <pluginRepositories>
                    <pluginRepository>
                        <id>central</id>
                        <name>releases</name>
                        <url>http://repo1.maven.org/maven2/</url>
                        <releases>
                            <updatePolicy>always</updatePolicy>
                            <enabled>true</enabled>
                        </releases>
                        <snapshots>
                            <updatePolicy>always</updatePolicy>
                            <enabled>true</enabled>
                        </snapshots>
                    </pluginRepository>
                </pluginRepositories>
            </profile>
        </profiles>
        <activeProfiles>
            <activeProfile>nexus</activeProfile>
        </activeProfiles>
    </settings>
    

1 个答案:

答案 0 :(得分:0)

回答您的疑问:

  

maven版本是否与其他应用程序罐相关?像maven 3.5.0   版本可以下载2.8.1版本的jackson-dataformat-xml和3.3.3   无法下载?

不,maven应该完美运作。

  

如果有的话,我们如何管理这些依赖?

可能它不是依赖性问题,而是系统/客户端工具。 请从控制台尝试->get(['bookings.*', 'vehicles.*', 'e1.name as driver_name', 'e2.name as conductor_name', 'e3.name as helper_name']); ,并确保您具有存储库访问权限。

编辑:基于OP评论

  

使用settings.xml更新了问题语句,请帮忙。而我还没有   验证构建服务器上的settings.xml。但它能够下载   除了这个之外的所有其他包装都是我的担心。

mvn clean install中提到的存储库是settings.xml,它有jar。

enter image description here