How to fix 'No plugin found for prefix 'archetype' error when creating a maven project

Hamza Ince

I tried creating a Maven project with the command:

mvn archetype:generate

Unfortunately, it didn't work, so I searched on the net. Thanks to stackoverflow, I understood that the error had to do with the proxy of my company, so I've created a settings.xml file in :

${user.home}/.m2/settings.xml

Here is the settings.xml file :

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">

  <proxies>
    <proxy>
      <id>my_id</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>my_host</host>
      <port>my_port</port>
      <nonProxyHosts>localhost|127.0.0.1|*.my_company.com</nonProxyHosts>
    </proxy> 
  </proxies>
</settings>

the proxy tag was given by a coworker, it should be correct.
However, I still have an error, here is the error message:

[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
***
Some warnings here
***
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from https://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 (https://repo.maven.apache.org/maven2): Access denied to: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://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 (https://repo.maven.apache.org/maven2): Access denied to: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.285 s
[INFO] Finished at: 2019-04-09T16:05:17+02:00
[INFO] ------------------------------------------------------------------------
[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 (C:\Users\ho.hince\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

C:\Users\ho.hince\Desktop\Spring\test>mvn archetype: generate
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.132 s
[INFO] Finished at: 2019-04-09T16:09:58+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\ho.hince\Desktop\Spring\test). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

I wondered if the host or the port number was wrong, so I've tried to change it multiple times to see what would happen.
When I change the port number to a random port, I still have the same error, but the process slow down considerably.

I've searched the solution on this website and on other site for hours, but still can't find a soultion.
I am sincerily sorry, if I made a mistake in this question, but I've spent half an hour to make it and made sure to follow instructions.

Thank you in advance. :)
P.S: Sorry, for english errors, it is not my main language.

Hamza Ince

I found a solution, I changed the settings.xml server tag.
I changed it to an Nexus url, so that, I download the jars of my company.

I needed to import certificates in JAVA, if you have the same problem with SSL certificate.

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

You can find an answer in this video:
https://www.youtube.com/watch?v=z3tAp3m5YBo

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fix "No plugin found for prefix 'liquibase' in the current project and in the plugin groups"

Maven - No plugin found for prefix 'wildfly' in the current project

Maven archetype error while creating a new Apache Apex project

How to fix error creating bean with name error in maven project

ERROR No plugin found for prefix 'spring' in the current project

How to embed archetype project version in Maven archetype?

maven release:prepare gives [ERROR] No plugin found for prefix 'C' in the current project

Maven Error No POM in this Project when performing archetype:generate

How to fix 'command not found' error in Databricks when creating a secret scope

How to fix 'Class not found' error in PHP when activating plugin in wordpress?

Maven: No plugin found for prefix 'dockerfile'

Archetype plugin error in "Maven in 5 Minutes" tutorial

"Plugin not found for prefix app engine" when using maven

Flyway Maven plugin no longer working: No plugin found for prefix 'flyway' in the current project and in the plugin groups

How to fix AEM 6.3 - Maven Archetype 12 "No DS descriptor found" errors?

Error when creating a new maven project

Maven- No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

Maven - No plugin found for prefix 'tomcat7' in the current project and in the plugin groups

How to create a Maven project from an archetype?

Archetype for Maven Project

Main class not found error while creating Maven Project in Scala IDE

Error Creating a Maven Project

JavaFx 12 Spring, Maven No plugin found for prefix

How to fix this multisampling error when creating a swapchain?

How can I fix the "invalid character" error when creating a project in Azure Form Recognizer labeling tool

Maven Archetype: How to add more than one archetype in same maven-plugin?

How to fix 'Not found: Files /bigstore/project/testing/filename.json' error when loading into Bigquery

Error executing Maven archetype generate command to create a Opendaylight project structure

No plugin found for prefix 'gcloud' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]