无法读取localhost Nexus存储库中存在的工件的工件描述符

时间:2013-09-10 21:09:14

标签: maven

所以我为部署到我当地的Nexus的插件遇到了错误Failed to read artifact descriptor。我检查了Nexus上的pom。 这个插件依赖于Maven 2.2.1,我正在使用Maven 3.0.4。这可能是个问题吗?

<repositories>
    <repository>
        <id>public</id>
        <url>http://localhost:8081/nexus/content/groups/public</url>
    </repository>
</repositories>


   [ERROR] Plugin com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha21-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.atlassian.maven.plugins:maven-jgitflow-plugin:jar:1.0-alpha21-SNAPSHOT: Could not find artifact com.atlassian.maven.plugins:maven-jgitflow-plugin:pom:1.0-alpha21-SNAPSHOT -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha21-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.atlassian.maven.plugins:maven-jgitflow-plugin:jar:1.0-alpha21-SNAPSHOT
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:235)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    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:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.atlassian.maven.plugins:maven-jgitflow-plugin:jar:1.0-alpha21-SNAPSHOT
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)
    ... 20 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.atlassian.maven.plugins:maven-jgitflow-plugin:pom:1.0-alpha21-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
    ... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.atlassian.maven.plugins:maven-jgitflow-plugin:pom:1.0-alpha21-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
    ... 26 more

2 个答案:

答案 0 :(得分:9)

啊,发现了这个问题。我使用的是<repositories>代码。使用Maven 3所以我需要将<pluginRepositories>标签添加到我的pom中以获得此依赖性

<pluginRepositories>
    <repository>
        <id>public</id>
        <url>http://localhost:8081/nexus/content/groups/public</url>
    </repository>
</pluginRepositories>

答案 1 :(得分:-2)

请检查<dependencies>标记前的pom中是否存在以下内容:

<properties>
    <spring.version>3.0.5.RELEASE</spring.version>
</properties>