Maven 寻找错误的原型包装
我成功创建了一个原型。 该原型在我公司的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论