Eclipse java - 如何在 Maven 中包含 Jersey 原型?

Eclipse java - How do I include Jersey archetype in Maven?

我正在尝试使用 Maven Jersey 原型创建 Web 应用程序,但在搜索它时,它没有给我任何结果。

如果我需要为此设置任何内容或如何获得搜索结果,请问可以吗?

预计:

实际:

您需要将 Jersey Maven Archetype 添加到您的 Eclipse,因为您的目录不是最新版本。

转到 Preferences -> Maven -> Archetypes ->Add Remote Catalog 并添加这些参数:

Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description: maven catalog

Note: Probably It's necesary to restart your Eclipse.

更新一是:

  1. 转到首选项 -> Maven -> 原型 -> 添加远程目录和 添加这些参数:

  2. 目录文件: https://repo.maven.apache.org/maven2/archetype-catalog.xml

  3. 说明:maven目录

单击验证以检查远程 link。

注意:重新启动 Eclipse

来源:https://maven.apache.org/archetype/archetype-models/archetype-catalog/archetype-catalog.html

Archetype 插件默认知道它的内部目录。它还知道本地和远程目录:

local代表~/.m2/archetype-catalog.xml目录文件,

remote 表示 https://repo.maven.apache.org/maven2/archetype-catalog.xml 目录文件。