我正在尝试创建一个基于Maven的Jersey快速入门Web应用程序。我正在选择glassfish原型。但它给了我下面给出的错误。它成功创建了com.sun.jersey原型项目。但是对于glassfish来说,它有问题。我的笔记本电脑中没有可能干扰下载过程的代理设置。我需要尽快解决这个问题。
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
答案 0 :(得分:3)
原型的工件中似乎存在拼写错误:缺少连字符。它是“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
答案 1 :(得分:0)
以下是我在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
答案 2 :(得分:0)