Maven原型:生成过多的选择
根据maven site,以及网络上的一些教程,mvn archetype:generate 会给出大约 36 个选项,选择 15 是快速启动。它一直以这种方式工作,直到我设置 Nexus 。现在我可以选择 358,默认值为 97(我无法从 dos 提示符中读取说明)。两个选择一样吗?为什么现在我有这么多选择。如果我必须更改存储库设置,如何纠正它。我的maven版本是
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_16
Java home: C:\Program Files\Java\jdk1.6.0_16\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
谢谢。
339: remote -> parallelj-archetype (ParallelJ is a Java framework for parallel computing. It provides flow modeling and execution.)
340: remote -> parancoe-pluginarchetype (-)
341: remote -> parancoe-webarchetype (-)
342: remote -> liftweb-archetype-blank (Archetype - blank project for liwftweb)
343: remote -> liftweb-archetype-hellolift (Archetype - hellolift sample liwftweb application)
344: remote -> scala-archetype-simple (The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.)
345: remote -> slf4j-archetype (The slf4j Archetype)
346: remote -> flexmojos-archetypes-application (-)
347: remote -> flexmojos-archetypes-library (-)
348: remote -> flexmojos-archetypes-modular-webapp (-)
349: remote -> nexus-plugin-archetype (-)
350: remote -> spring-osgi-bundle-archetype (Spring OSGi Maven2 Archetype)
351: remote -> spring-ws-archetype (Spring Web Services Maven2 Archetype.)
352: remote -> trails-archetype (-)
353: remote -> trails-secure-archetype (-)
354: remote -> tynamo-archetype (-)
355: remote -> wicket-scala-archetype (Basic setup for a project that combines Scala and Wicket,
depending on the Wicket-Scala project. Includes an example Specs
test.)
356: remote -> wikbook.archetype (-)
357: remote -> circumflex-archetype (-)
358: remote -> javg-minimal-archetype (-)
Choose a number: 97:
According to maven site, and some tutorials on the web, mvn archetype:generate would give a choice of about 36, and selection 15 is the quick start. It was working this way until I setup Nexus . Now I get a choice of 358 with default as 97 (which I am could not read the description from my dos prompt). Is both choices are same? Why now I get these many choices. How to correct it if I have to change my repository setttings. My maven version is
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_16
Java home: C:\Program Files\Java\jdk1.6.0_16\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
Thanks.
339: remote -> parallelj-archetype (ParallelJ is a Java framework for parallel computing. It provides flow modeling and execution.)
340: remote -> parancoe-pluginarchetype (-)
341: remote -> parancoe-webarchetype (-)
342: remote -> liftweb-archetype-blank (Archetype - blank project for liwftweb)
343: remote -> liftweb-archetype-hellolift (Archetype - hellolift sample liwftweb application)
344: remote -> scala-archetype-simple (The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.)
345: remote -> slf4j-archetype (The slf4j Archetype)
346: remote -> flexmojos-archetypes-application (-)
347: remote -> flexmojos-archetypes-library (-)
348: remote -> flexmojos-archetypes-modular-webapp (-)
349: remote -> nexus-plugin-archetype (-)
350: remote -> spring-osgi-bundle-archetype (Spring OSGi Maven2 Archetype)
351: remote -> spring-ws-archetype (Spring Web Services Maven2 Archetype.)
352: remote -> trails-archetype (-)
353: remote -> trails-secure-archetype (-)
354: remote -> tynamo-archetype (-)
355: remote -> wicket-scala-archetype (Basic setup for a project that combines Scala and Wicket,
depending on the Wicket-Scala project. Includes an example Specs
test.)
356: remote -> wikbook.archetype (-)
357: remote -> circumflex-archetype (-)
358: remote -> javg-minimal-archetype (-)
Choose a number: 97:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我一直在寻找相同的解决方案,并且似乎找到了一个可用的解决方案,尽管它可能并不适合所有人。
这个想法是创建一个本地原型目录并指定您可能需要的所有原型。
这样您就只能得到您感兴趣的选择。
当然,您可能会发现需要在那里添加新的原型,然后您需要回退到远程存储库的正常使用或手动添加它。
秘诀:
使用以下命令创建初始本地目录
mvn archetype:crawl -Dcatalog=~/.m2/archetype-catalog.xml
仅将目录列表从本地目录传递到 archetype:generate
mvn archetype:generate -DarchetypeCatalog=local
您将看到类似这样的内容:
您可以通过在 settings.xml 中指定该选项来使其永久化:
现在,当您想要回退到通常的 Maven 目录列表时,运行它
,您将拥有所有可用的原型。
I was looking for the same solution and I seem to find a usable one, though it may not suit everyone.
The idea is to create a local archetype catalog and specify all archetypes you may need there.
This way you'll get only choices you're interested.
Of course you may find you'll need to add new archetype there, then you'll need either to fallback to normal use of remote repository or add it by hand.
The recipe:
Create the initial local catalog with
mvn archetype:crawl -Dcatalog=~/.m2/archetype-catalog.xml
Pass catalog list from only you're local catalog to archetype:generate
mvn archetype:generate -DarchetypeCatalog=local
You will see something like this:
You can make the option permanent by specifying it in your settings.xml:
Now when you want to fallback to usual Maven catalog list, run it as
and you will have all archetypes available.
我看到 maven 3 可用并且安装时没有 Nexus.. 给出了与下面相同数量的选择。所以,不知怎的,我早些时候得到了maven 3原型..似乎97是一个不错的选择..
I see maven 3 is available and installed without nexus.. that gave same number of choices as below. So, somehow I was getting maven 3 archetype earlier.. seems like 97 is a good choice..
您仍然可以使用
选择 15
作为快速入门。就忽略别人吧。You can still use
choice 15
as a quick start. Just ignore others.