mavennexusarchetypes

Maven Error: No plugin found for prefix ‘archetype’ in the current project using Nexus


I am trying to setup MAVEN in my company's local network which is not connected to the internet directly. Also I'm using sonatype nexus for my central repository.

Problem starts when I run the command mvn archetype:create. The result is always build failure.

error no plugin found for prefix 'archetype' in the current project.

How do I solve this issue?


Solution

  • Maven is trying to look up the full plugin artifact ID that corresponds the "archetype" prefix.

    To do this it reads the available prefixes from this path: /org/apache/maven/plugins/maven-metadata.xml

    Since you're using Nexus this is likely coming from a group repository, e.g.:

    http://:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml

    You'll need to look carefully at your maven configuration and your build log to see where exactly it is trying to retrieve this information. There will likely be additional information about the failure if you run Maven with the debug ("-X") flag.

    If it's trying to retrieve it from your Nexus instance see here for information on how to diagnose the issue:

    https://support.sonatype.com/entries/21437881