2013-09-10 60 views
4

因此,對於已部署到本地Nexus的插件,我遇到錯誤Failed to read artifact descriptor。我在Nexus上查了一下pom。 這個插件對Maven 2.2.1有依賴性,我正在使用Maven 3.0.4。這可能是一個問題嗎?無法讀取本地主機中存在的工件的工件描述符Nexus回購

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

根本原因似乎是這:*無法找到工件com.atlassian.maven.plugins:maven-jgitflow-plugin:pom:1.0-alpha21-SNAPSHOT *。這個POM神器是否可用? – Tome

+0

是的可用: nexusip:8081/nexus/content/repositories/snapshots/com/atlassian/maven/plugins/maven-jgitflow-plugin/1.0-alpha21-SNAPSHOT/maven-jgitflow-plugin-1.0-alpha21 -20130910.173420-2.pom – DarVar

+0

我不記得是否默認允許SNAPSHOT,您可以嘗試使用此配置您的回購: true? – Tome

回答

9

啊發現這個問題。我正在使用<repositories>標籤。使用Maven 3所以我需要<pluginRepositories>標籤添加到我的POM得到這種依賴性

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

你能否告訴我一些如何做到這一點? – Sridhar

+0

呵呵?使用而不是標籤來處理Maven插件的依賴關係 – DarVar

+0

沒有鍛鍊的dud – Sridhar

-2

請檢查是否存在下列您的POM中<dependencies>標記之前:

<properties> 
    <spring.version>3.0.5.RELEASE</spring.version> 
</properties> 
相關問題