Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "No plugin found for prefix 'archetype' in the current project and in the plugin groups" getting in creating new java maven project

Tags:

java

xml

maven

I am trying to create a new java maven project in Netbeans 8.2 . I am following the below steps:

enter image description here

enter image description here

Logs:

Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.0: Plugin org.apache.maven.plugins:maven-site-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.0
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.914s
Finished at: Sat Feb 08 10:44:37 BDT 2020
Final Memory: 7M/119M

But I am getting this error.

No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/sultan/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
like image 219
Christopher Marlowe Avatar asked Feb 08 '20 04:02

Christopher Marlowe


2 Answers

same issue I got, and similarly on Netbeans 8.2:

Within the Netbeans installation, this settings update worked for me:

Goto Netbeans installation folder > java > maven > conf

for me it was C:\Program Files\NetBeans 8.2\java\maven\conf, and here I updated the settings.xml file using administrative privilege.

as http repo link will not work now, just I created an valid https mirror for central repo that is pre-built with IDE which cannot be changed.

Add this inside mirrors tag of settings.xml

<mirror>
      <id>mirror1</id>
      <mirrorOf>central</mirrorOf>
      <name>mirror1</name>
      <url>https://repo.maven.apache.org/maven2/</url>
</mirror>

after this restart Netbeans IDE, and central repository will be overridden with the mirror we specified https://repo.maven.apache.org/maven2/.

like image 72
Karthik Kumar Avatar answered Dec 02 '22 20:12

Karthik Kumar


The part of output says ReasonPhrase:HTTPS Required, so therefore it cannot make proper request to the http endpoint.

Try changing the URLs to the maven central repository in your maven settings.
The globals are in: ${maven.home}/conf/settings.xml
And user settings in: ${user.home}/.m2/settings.xml
There's possibility that you're using maven which comes with Netbeans installation, then you'd need to search for that setting file in netbeans installation folder. Try going to Tools/Options/Maven on netbeans interface - there should be info about the location currently used maven directory.

Search the repo.maven.apache.org/maven2 (or the whole URL from your logs) through those files and change the http to https.
Just to add, the error contains the http://repo.maven.apache.org/maven2 URL - prehaps you can search for it in that settings.xml files and change http to https.

Take a look at this two questions for more info:
Can not find where maven local repository path in netbeans 8.0.2 is set
Change Maven repository that NetBeans uses
For other info, go through short description in:
https://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

like image 24
itwasntme Avatar answered Dec 02 '22 21:12

itwasntme