Maven Error: No plugin found for prefix ‘archetype’ in the current project using Nexus
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
esthrim
Updated on June 14, 2022Comments
-
esthrim almost 2 years
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?
-
esthrim almost 10 yearsyes you are correct, i add the -X flag, and it show Could not find metada org.apache.maven.plugins/maven-metadata.xml in http://..:8080/nexus/content/repositories/MavenRepo1. and after i checked in the MavenRepo1 directory, it does contain the file. but why maven could not get the file?
-
esthrim almost 10 yearsafter i right clicked in my nexus repository and rebuild metadata and expire cache, and waiting for some times, somehow the error for maven-metadata is not showing again, but it shows another error : Error reading archetype catalog repo1.maven.org/maven2 org.apache.maven.wagon.TransferFailedException: repo1.maven.org, why maven is trying to connect to repo1.maven.org ? because i already set to nexus.
-
Manfred Moser almost 10 yearsYour settings.xml file must be misconfigured. Check books.sonatype.com/nexus-book/reference/config.html for how to have a correct settings.xml for a single nexus group.