问题描述
我只是创建了自定义原型项目,并且完美运行了" mvn install "命令.
I just create my custom archetype project, and I run perfectly the "mvn install" command.
在我的本地存储库中,通过m2/repository/com/mycomp/archetype-project-name
正确添加了我的原型项目.
(但它不是在原型文件夹中创建的:m2/repository/org/apache/maven/archetypes
:也许是正常的)
In my local repository, my archetype project was added correctly via m2/repository/com/mycomp/archetype-project-name
.
(but it was not created in the archetype folder : m2/repository/org/apache/maven/archetypes
: maybe it's normal)
但是现在我无法在"mvn archetype:generation"命令中使用新的自定义原型:
But now I can't use my new custom archetype with the "mvn archetype:generation" command :
- 参数很好Maven告诉我他没有找到原型
- 没有参数,原型列表中不存在我的原型.
我也应该执行mvn deploy
命令吗?我试过了,但是我还没有配置另一个内部存储库,但是它失败了.
Should I execute the mvn deploy
command too ?I tried this, but I haven't configure another internal repository yet and it fails.
预先感谢您的帮助
推荐答案
我找到了一个解决方案:当我安装原型时,我需要使用 archetype:update-locate-catalog 这样的选项:
I've found a solution :when I install my archetype I need to use the option archetype:update-locate-catalog like this :
代替简单的"mvn install"命令.
Instead a simple "mvn install" command.
现在,当我想生成一个新的自定义项目时,我可以在本地目录中找到我的新自定义原型:
And now I find my new custom archetrype in the local catalog when I want generate a new custom project :
这篇关于如何在Maven中使用我的自定义原型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!