无法从maven下载jersey-quickstart-webapp

时间:2017-03-29 15:24:22

标签: java maven web-applications jersey

我正在尝试使用maven下载jersey-quickstart-webapp。我无法弄清楚下面的命令有什么问题。

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes  -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2

我得到的错误如下:我在这里做错了什么?

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) > generate-sources @ standalone-pom

[INFO] Generating project in Interactive mode
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[WARNING] Archetype not found in any catalog. Falling back to central repository
(http://repo.maven.apache.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo.maven.apache.org/maven2/org/glassfish/jersey/archetypes/jersey-quickstart-webapp/2.2/jersey-quickstart-webapp-2.2.pom
Downloading: https://repo.maven.apache.org/maven2/org/glassfish/jersey/archetypes/jersey-quickstart-webapp/2.2/jersey-quickstart-webapp-2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.330 s
[INFO] Finished at: 2017-03-29T20:46:00+05:30
[INFO] Final Memory: 14M/139M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.2) -> [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.

2 个答案:

答案 0 :(得分:1)

您指定的版本是错误的(不是2.2 2.25.1)。试着运行:

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes  -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.25.1

答案 1 :(得分:0)

问题不在于命令,而在于settings.xml。 我不得不添加我的本地神器setton