Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to read artifact descriptor for artifact present in my localhost Nexus repo

Tags:

maven

So I'm hitting an error Failed to read artifact descriptor for a plugin that has been deployed to my local Nexus. I checked the pom on Nexus. This plugin has dependencies on Maven 2.2.1 and I'musing Maven 3.0.4. Could that be a problem?

<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
like image 331
DarVar Avatar asked Mar 23 '23 11:03

DarVar


1 Answers

Ah found the issue. I was using <repositories> tag. Using Maven 3 so I needed to add <pluginRepositories> tags to my pom to get this dependency

<pluginRepositories>
    <repository>
        <id>public</id>
        <url>http://localhost:8081/nexus/content/groups/public</url>
    </repository>
</pluginRepositories>
like image 103
DarVar Avatar answered Apr 25 '23 01:04

DarVar