Specify archetype for archetype:generate on command line

我是研究僧i 提交于 2020-01-21 10:43:06

问题


I'm generating a Maven archetype for a simple project. I use archetype:generate, and it gives me a list of types of archetypes to generate. I'm pretty sure I want

99: remote -> maven-archetype-quickstart (An archetype which contains a sample Maven project.)

I can just enter "99" interactively, but I'm trying to write a blog post. I don't want to tell my readers "search for maven-archetype-quickstart in the hundreds of options", and I know it won't always be number 99.

So, how do I specify on the command line the archetype to generate?

(A similar question discusses which archetype to use, but not how to specify it non-interactively)


回答1:


You can provide arguments via system properties, as in:

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false



来源:https://stackoverflow.com/questions/4909455/specify-archetype-for-archetypegenerate-on-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!