Maven 寻找错误的原型包装

发布于 2025-01-04 13:46:38 字数 2555 浏览 1 评论 0原文

我成功创建了一个原型。 该原型在我公司的 Nexus 中引用,目录看起来结构良好。

但是,当我尝试从这个原型生成项目时,maven 将查找一个 jar,并且我的原型被打包为“maven-archetype”(请参阅​​下面的堆栈跟踪),

[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> com.XXX.archetypes:frameworkV4Project
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Downloading: http://XXX/content/repositories/xxx-releases/com/xxx/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository frameworkV4Project-repo (http://XXX/content/repositories/XXX-releases)
Downloading:     http://XXX/content/groups/XXX//com/XXX/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository XXX (http://XXX/content/groups/XXX/)
Downloading: http://XXX/content/groups/bdx-dev//com/XXX/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] The desired archetype does not exist (com.XXX.archetypes:frameworkV4Project:1.0.0)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Feb 10 16:38:13 CET 2012
[INFO] Final Memory: 28M/247M
[INFO] ------------------------------------------------------------------------
D:\workspace\xxx\frameworkV4Project>

这是在 nexus 上找到的目录文件:

<archetype-catalog>
 <archetypes>
  <archetype>
   <groupId>com.rte.archetypes</groupId>
  <artifactId>frameworkV4Project</artifactId>
  <version>1.0.0</version>
</archetype>

如果我打包我的原型“old school”作为一个jar,nexus不会引用它(nexus的原型目录是动态生成的,无法编辑它)。看起来 Nexus 在其目录中只引用了“maven-archetype”工件。

我缺少什么?需要将原型定义为 jar 打包的原型吗?或者我可以在某个地方指定包装专家必须寻找的类型吗?

谢谢你,

马修。

I successfully created an archetype.
The archetype is referenced in my company's Nexus, the catalog looks well formed.

But when I try to generate a project from this archetype, maven will look for a jar, and my archetype is packaged as a 'maven-archetype' (see the stack trace below)

[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> com.XXX.archetypes:frameworkV4Project
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Downloading: http://XXX/content/repositories/xxx-releases/com/xxx/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository frameworkV4Project-repo (http://XXX/content/repositories/XXX-releases)
Downloading:     http://XXX/content/groups/XXX//com/XXX/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository XXX (http://XXX/content/groups/XXX/)
Downloading: http://XXX/content/groups/bdx-dev//com/XXX/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar
[INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] The desired archetype does not exist (com.XXX.archetypes:frameworkV4Project:1.0.0)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Feb 10 16:38:13 CET 2012
[INFO] Final Memory: 28M/247M
[INFO] ------------------------------------------------------------------------
D:\workspace\xxx\frameworkV4Project>

here's the catalog file found on nexus :

<archetype-catalog>
 <archetypes>
  <archetype>
   <groupId>com.rte.archetypes</groupId>
  <artifactId>frameworkV4Project</artifactId>
  <version>1.0.0</version>
</archetype>

If I package my archetype "old school" as a jar, nexus won't reference it (the archetype catalog of nexus is generated on the fly, can't edit it). Looks like Nexus only references 'maven-archetype' artifacts in its catalog.

What am i missing ? need to define the archetype as a jar packaged archetype ? or can I specify somewhere the type of packaging maven must look for ?

Thank you,

Mathieu.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文