Maven依赖项错误-抱怨存储库中显示的依赖项

时间:2018-07-27 02:30:37

标签: java maven maven-2 teamcity maven-3

我在执行Mavin buuild时遇到此错误:

[Step 2/4] Failed to execute goal on project m2tr-csheq-domain: Could not 
resolve dependencies for project com.citi.mifid2:m2tr-csheq-domain:jar:1.4.0- 
SNAPSHOT: Failed to collect dependencies for [com.citi.mifid2:m2tr- 
commons:jar:1.4.0-SNAPSHOT (compile), org.apache.storm:storm-core:jar:1.1.0 
(provided), com.citi.mifid2:storm-commons:jar:1.4.0-SNAPSHOT (compile), 
com.citi.mifid2:commons:jar:1.4.0-SNAPSHOT (compile), org.apache.kafka:kafka- 
clients:jar:0.11.0.2 (compile), com.esotericsoftware:kryo:jar:4.0.0 
(provided), junit:junit:jar:4.12 (test), com.citi.mifid2:test- 
utils:jar:1.4.0-SNAPSHOT (test)]

这是POM文件:

<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>

<parent>
    <groupId>com.citi.mifid2</groupId>
    <artifactId>m2tr</artifactId>
    <version>1.4.0-SNAPSHOT</version>
    <relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>m2tr-csheq-domain</artifactId>
<packaging>jar</packaging>
<name>m2tr-csheq-domain</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <provided.scope>provided</provided.scope>
    <nexus.releases.url>https://www.artifactrepository.citigroup.net:443/artifactory/maven-icg-teamdev-local</nexus.releases.url>
    <nexus.snapshots.url>https://www.artifactrepository.citigroup.net:443/artifactory/maven-icg-teamdev-local</nexus.snapshots.url>
</properties>

<dependencies>
    <dependency>
        <groupId>com.citi.mifid2</groupId>
        <artifactId>m2tr-commons</artifactId>
        <version>1.4.0-SNAPSHOT</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
</build>

<distributionManagement>
    <repository>
        <id>Releases</id>
        <name>Releases</name>
        <url>${nexus.releases.url}</url>
    </repository>
    <snapshotRepository>
        <id>Snapshots</id>
        <name>Snapshots Releases</name>
        <url>${nexus.snapshots.url}</url>
    </snapshotRepository>
</distributionManagement>
<repositories>
    <repository>
        <id>uno-service-snapshots</id>
        <name>Uno Service Snapshots</name>
        <url>${nexus.snapshots.url}</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

这是依赖项POM文件:

<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>

<groupId>com.citi.mifid2</groupId>
<artifactId>m2tr-commons</artifactId>

<version>1.4.0-SNAPSHOT</version>

<name>m2tr-commons</name>
<packaging>jar</packaging>

<parent>
    <groupId>com.citi.mifid2</groupId>
    <artifactId>m2tr</artifactId>

    <version>1.4.0-SNAPSHOT</version>

    <relativePath>../pom.xml</relativePath>
</parent>

<dependencies>

    <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-core</artifactId>
        <type>test-jar</type>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

我确实看到为M2TR-COMMONS创建的依赖项存储库,从属项目应该可以找到它,但是它抱怨。对于寻找此依赖项(M2TR-COMMONS)的其他项目,他们也抱怨。

完整的错误堆栈:

[23:10:43][Step 2/4] [ERROR] Failed to execute goal on project m2tr-csheq-domain: Could not resolve dependencies for project com.citi.mifid2:m2tr-csheq-domain:jar:1.4.0-SNAPSHOT: Failed to collect dependencies for [com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT (compile), org.apache.storm:storm-core:jar:1.1.0 (provided), com.citi.mifid2:storm-commons:jar:1.4.0-SNAPSHOT (compile), com.citi.mifid2:commons:jar:1.4.0-SNAPSHOT (compile), org.apache.kafka:kafka-clients:jar:0.11.0.2 (compile), com.esotericsoftware:kryo:jar:4.0.0 (provided), junit:junit:jar:4.12 (test), com.citi.mifid2:test-utils:jar:1.4.0-SNAPSHOT (test)]: Failed to read artifact descriptor for com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT: Could not find artifact com.citi.mifid2:m2tr:pom:1.4.0-SNAPSHOT in ear-maven-teamdev (https://www.artifactrepository.citigroup.net/artifactory/list/maven-teamdev/) -> [Help 1]
[23:10:43][Step 2/4] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project m2tr-csheq-domain: Could not resolve dependencies for project com.citi.mifid2:m2tr-csheq-domain:jar:1.4.0-SNAPSHOT: Failed to collect dependencies for [com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT (compile), org.apache.storm:storm-core:jar:1.1.0 (provided), com.citi.mifid2:storm-commons:jar:1.4.0-SNAPSHOT (compile), com.citi.mifid2:commons:jar:1.4.0-SNAPSHOT (compile), org.apache.kafka:kafka-clients:jar:0.11.0.2 (compile), com.esotericsoftware:kryo:jar:4.0.0 (provided), junit:junit:jar:4.12 (test), com.citi.mifid2:test-utils:jar:1.4.0-SNAPSHOT (test)]
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[23:10:43][Step 2/4]    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[23:10:43][Step 2/4]    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[23:10:43][Step 2/4]    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[23:10:43][Step 2/4]    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[23:10:43][Step 2/4]    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[23:10:43][Step 2/4]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[23:10:43][Step 2/4]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[23:10:43][Step 2/4]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[23:10:43][Step 2/4]    at java.lang.reflect.Method.invoke(Method.java:498)
[23:10:43][Step 2/4]    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[23:10:43][Step 2/4]    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[23:10:43][Step 2/4]    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[23:10:43][Step 2/4]    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[23:10:43][Step 2/4] Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.citi.mifid2:m2tr-csheq-domain:jar:1.4.0-SNAPSHOT: Failed to collect dependencies for [com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT (compile), org.apache.storm:storm-core:jar:1.1.0 (provided), com.citi.mifid2:storm-commons:jar:1.4.0-SNAPSHOT (compile), com.citi.mifid2:commons:jar:1.4.0-SNAPSHOT (compile), org.apache.kafka:kafka-clients:jar:0.11.0.2 (compile), com.esotericsoftware:kryo:jar:4.0.0 (provided), junit:junit:jar:4.12 (test), com.citi.mifid2:test-utils:jar:1.4.0-SNAPSHOT (test)]
[23:10:43][Step 2/4]    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:158)
[23:10:43][Step 2/4]    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
[23:10:43][Step 2/4]    ... 22 more
[23:10:43][Step 2/4] Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT (compile), org.apache.storm:storm-core:jar:1.1.0 (provided), com.citi.mifid2:storm-commons:jar:1.4.0-SNAPSHOT (compile), com.citi.mifid2:commons:jar:1.4.0-SNAPSHOT (compile), org.apache.kafka:kafka-clients:jar:0.11.0.2 (compile), com.esotericsoftware:kryo:jar:4.0.0 (provided), junit:junit:jar:4.12 (test), com.citi.mifid2:test-utils:jar:1.4.0-SNAPSHOT (test)]
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
[23:10:43][Step 2/4]    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)
[23:10:43][Step 2/4]    ... 23 more
[23:10:43][Step 2/4] Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.citi.mifid2:m2tr-commons:jar:1.4.0-SNAPSHOT
[23:10:43][Step 2/4]    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:331)
[23:10:43][Step 2/4]    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
[23:10:43][Step 2/4]    ... 25 more
[23:10:43][Step 2/4] Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.citi.mifid2:m2tr:pom:1.4.0-SNAPSHOT in ear-maven-teamdev (https://www.artifactrepository.citigroup.net/artifactory/list/maven-teamdev/)
[23:10:43][Step 2/4]    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)
[23:10:43][Step 2/4]    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
[23:10:43][Step 2/4]    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
[23:10:43][Step 2/4]    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
[23:10:43][Step 2/4]    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
[23:10:43][Step 2/4]    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:322)
[23:10:43][Step 2/4]    ... 28 more
[23:10:43][Step 2/4] Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.citi.mifid2:m2tr:pom:1.4.0-SNAPSHOT in ear-maven-teamdev (https://www.artifactrepository.citigroup.net/artifactory/list/maven-teamdev/)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
[23:10:43][Step 2/4]    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
[23:10:43][Step 2/4]    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:122)
[23:10:43][Step 2/4]    ... 33 more
[23:10:43][Step 2/4] Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.citi.mifid2:m2tr:pom:1.4.0-SNAPSHOT in ear-maven-teamdev (https://www.artifactrepository.citigroup.net/artifactory/list/maven-teamdev/)
[23:10:43][Step 2/4]    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
[23:10:43][Step 2/4]    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
[23:10:43][Step 2/4]    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
[23:10:43][Step 2/4]    at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
[23:10:43][Step 2/4]    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[23:10:43][Step 2/4]    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[23:10:43][Step 2/4]    at java.lang.Thread.run(Thread.java:748)
[23:10:43][Step 2/4] [ERROR] 
[23:10:43][Step 2/4] [ERROR] 
[23:10:43][Step 2/4] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[23:10:43][Step 2/4] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

谢谢。

0 个答案:

没有答案