我成功创建了一个原型。 原型在我公司的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打包的原型?或者我可以在某处指定包装专业人员必须寻找的类型吗?
谢谢,
马修。