W3docs

Create a Maven project in Eclipse complains "Could not resolve archetype"

There could be several reasons why you are getting the error "Could not resolve archetype" when trying to create a Maven project in Eclipse.

There could be several reasons why you are getting the error "Could not resolve archetype" when trying to create a Maven project in Eclipse. Here are a few things you can try:

  1. Update the Maven Archetype Catalog: This is the most common fix. Eclipse caches archetype definitions, and an outdated or corrupted cache causes this error. Go to Window > Preferences > Maven > Archetypes, then click Update Catalogs... and wait for the download to finish.
  2. Make sure that you have a valid internet connection. Maven requires an internet connection to download the necessary dependencies and plugins, so if you are offline or have a weak internet connection, you may get this error.
  3. Make sure that you are using the correct coordinates for the archetype. The archetype coordinates consist of three values: groupId, artifactId, and version. Make sure that these values are correct and correspond to a valid archetype that is available in the Maven repository.
  4. Make sure that you are using the correct repository URL. The repository URL specifies the location of the Maven repository from which the archetype will be downloaded. Make sure the URL is correct and that the repository is available. You can configure custom repositories or mirrors in your settings.xml file:
    `<settings>`
      `<mirrors>`
        `<mirror>`
          `<id>`central`</id>`
          `<url>`https://repo.maven.apache.org/maven2`</url>`
          `<mirrorOf>`central`</mirrorOf>`
        `</mirror>`
      `</mirrors>`
    `</settings>`
  5. If you are using a corporate proxy or firewall, make sure that it is configured correctly and that it is not blocking the connection to the Maven repository.
  6. If you are using Eclipse behind a proxy, you may need to configure the proxy settings in Eclipse. To do this, go to the "Window" menu, select "Preferences", and then navigate to "General" > "Network Connections". Select the "Active Provider" as "Manual", and then enter the proxy settings in the "HTTP", "HTTPS", and "SOCKS" sections.

I hope this helps. Let me know if you have any questions.