Maven的archetype Plugin可能你们都听过,但不必定都能很好地用好它。缺省地若是你使用html
mvn archetype:generate web
会从maven的Repository里查找全部支持的arche types,大概有500~600个。正由于是太多了,因此查找起来非常不方便。app
其实平时经常使用的arche type也就那么几个。像我会用到的:maven
1.simple start xml
2. web apphtm
3. Groovy basicget
很天然的就会考虑,是否是能什么简便的方法只须要从这3个组成的list里选择就能够了。 答案固然是: Yesit
实现步骤以下:(本机的Maven Repository目录在C:\Users\buha\.m2 )io
1. 使用mvn archetype:crawl 命令,它会在 C:\Users\buha\.m2\repository目录下生成一个archetype-catalog.xml文件方法
2.将archetype-catalog.xml移到上一层目录,也就是C:\Users\buha\.m2
3.这时再运行mvn archetype:generate -DarchetypeCatalog=local 就能够达到你想要的目的了。
是否是很方便啊。
想获得更全的archtetype-catalog.xml 能够访问: http://repo1.maven.org/maven2/archetype-catalog.xml