无法解析原型 org.glassfish.jersey.archetypes:jersey quickstart-webapp

Could not resolve archetype org.glassfish.jersey.archetypes:jersey quickstart-webapp

我正在尝试创建一个基于 Maven 的 Jersey 快速入门 Web 应用程序。我正在选择 glassfish 原型。但它给了我下面给出的错误。它正在成功创建 com.sun.jersey 原型项目。但是对于玻璃鱼来说,它有问题。我的笔记本电脑中没有代理设置,可能会干扰下载过程。我需要尽快解决这个问题。

Could not resolve archetype org.glassfish.jersey.archetypes:jersey quickstart-webapp:2.19 from any of the configured repositories.
Could not resolve artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19
Failure to transfer org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 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 artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from/to central (https://repo.maven.apache.org/maven2): connect timed out
Failure to transfer org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 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 artifact org.glassfish.jersey.archetypes:jersey-quickstart-webapp:jar:2.19 from/to central (https://repo.maven.apache.org/maven2): connect timed out

原型的工件中似乎存在拼写错误:缺少连字符。是 "jersey-quickstart-webapp" 而不是 "jersey quickstart-webapp"。

但是Maven Central也有超时,所以可能只是传输时MC不可用。

无论如何,在任何新的试用之前,删除文件夹:
- ~/.m2/repository/org/glassfish/jersey/archetypes/jersey quickstart-webapp
- ~/.m2/repository/org/glassfish/jersey/archetypes/jersey-quickstart-webapp

这是我在 eclipse 中得到解决方案的方法

    1. Go to window.
    2. Select Preferences.
    3. Select Maven.
    4. Select Archetypes
    5. Add remote catalog.
    6. catalog file :- [http://repo.maven.apache.org/maven2/archetype-catalog.xml][1]   
    Description :- Remote Archetype (You can mention your own) 
    7. Click on verify and it should say something like this 
                 Found 27166 archetype(s)
    8. Click on OK.
    9. Restart your eclipse.


  [1]: http://repo.maven.apache.org/maven2/archetype-catalog.xml
  1. 前往 window。
    1. Select 首选项。
    2. Select Maven.
    3. Select 原型
    4. 添加远程目录。
    5. 目录文件:- https://repo.maven.apache.org/maven2/archetype-catalog.xml
      描述:- 远程原型(您可以提及自己的原型)
    6. 点击确定。

日食 转到 window。 Select 偏好。 Select 专家。 Select 原型 添加远程目录。 目录文件:- https://repo.maven.apache.org/maven2/archetype-catalog.xml 描述:- 远程原型(你可以提及你自己的) 单击“确定”。