http://www.javaeye.com/topic/769535
可以说纠结了不少时间了
不知道为啥,到现在还没解决 ,用mvn archetyoe:generate 时总是会出现这样的情况:
正常的应该是
mvn archetype:generate [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:create] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetype:generate] Choose archetype: 1: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web application with Hibernate, Spring and JSF) ........ 35: internal -> maven-archetype-sar (JBoss Service Archive) 36: internal -> wicket-archetype-quickstart (A simple Apache Wicket project) Choose a number: (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36): 15 [INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from maven-archetype-quickstart-repo Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar 4K downloaded Define value for groupId: : com.company Define value for artifactId: : project Define value for version: : 1.0 Define value for package: : com.company.project Confirm properties configuration: .......
以前使用一直正常(有一段时间了)
可现在无论在哪台机器上都是这样的情况:
[INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [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: remote -> docbkx-quickstart-archetype (null) 2: remote -> gquery-archetype (null) 3: remote -> gquery-plugin-archetype (null) 4: remote -> liferay-layouttpl-archetype (Provides an archetype to create Liferay layout templates.) 5: remote -> liferay-portlet-archetype (Provides an archetype to create Liferay portlets.) ............................................ 290: 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.) 291: remote -> circumflex-archetype (null) Choose a number: 80: Choose version: ....
居然是这样,到了290了....
而且choose a nubmer 默认写了个80不知道啥意思..... 选以前的web项目(18) 不管用还是继续让我choose version
最后发现可以choose的version 只有 1 和2 ..
根本没有普通java项目和web项目
咋回事儿?
去官网,没解决
问Google,没有人遇到过这个问题。
希望路过的maven高手们关注下
最后只能这样创建了:mvn archetype:create -DgroupId=[your group id] -DartifactId=[your archetype id] -DarchetypeArtifactId=maven-archetype-webapp
这样虽然能解决问题 ,但我还是想找到上述问题的原因。
感谢 juvenshun 大哥的帮助,问题解决了!!!
以下是解决方案(引用):可以使用 $mvn archetype:generate -DarchetypeCatalog=internal archetypeCatalog表示插件使用的archetype元数据,默认值为remote,local,即中央仓库archetype元数据 (http://repo1.maven.org/maven2/archetype-catalog.xml)加上插件内置元数据的和 由于中央仓库的archetype太多,导致这个列表太长 因此自己指定仅用内置元数据(20个左右,好像),就可以解决你的烦恼了