First, I created an archetype project and installed it to the local maven repository.
Next, I ran mvn archetype:crawl
to generate an archetype-catalog.xml
at C:\Users\Administrator\.m2\repository\archetype-catalog.xml
.
<archetype>
<groupId>dfr.custom.archetypes</groupId>
<artifactId>archetype_webapp-archetype</artifactId>
<version>1.0</version>
<description>archetype_webapp</description>
</archetype>
When I want to use it to generate a new maven project,I can't find it use
mvn archetype:generate -DarchetypeCatalog=local
, I got "No archetype defined".
In addition, I tried to run mvn archetype:generate -DarchetypeCatalog=file://C:\Users\Administrator\\.m2\repository
,it worked.
Choose archetype:
1: file://C:\Users\Administrator\\.m2\repository
-> dfr.custom.archetypes:archetype_webapp-archetype (archetype_webapp)
...
9: file://C:\Users\Administrator\\.m2\repository -> org.jboss.spring.archetypes:spring-mvc-webapp (getting-started)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 3:
what went wrong?
I ran "mvn archetype:generate -DarchetypeCatalog=local -X" and I found the reason.
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
Maven home: E:\apache-maven-3.3.3
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: C:\soft\Java\jdk1.7.0_67\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
[DEBUG] Imported: javax.inject.* < plexus.core
[DEBUG] Imported: org.apache.maven.* < plexus.core
[DEBUG] Imported: org.apache.maven.artifact < plexus.core
[DEBUG] Imported: org.apache.maven.classrealm < plexus.core
[DEBUG] Imported: org.apache.maven.cli < plexus.core
[DEBUG] Imported: org.apache.maven.configuration < plexus.core
[DEBUG] Imported: org.apache.maven.exception < plexus.core
[DEBUG] Imported: org.apache.maven.execution < plexus.core
[DEBUG] Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG] Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG] Imported: org.apache.maven.model < plexus.core
[DEBUG] Imported: org.apache.maven.monitor < plexus.core
[DEBUG] Imported: org.apache.maven.plugin < plexus.core
[DEBUG] Imported: org.apache.maven.profiles < plexus.core
[DEBUG] Imported: org.apache.maven.project < plexus.core
[DEBUG] Imported: org.apache.maven.reporting < plexus.core
[DEBUG] Imported: org.apache.maven.repository < plexus.core
[DEBUG] Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG] Imported: org.apache.maven.settings < plexus.core
[DEBUG] Imported: org.apache.maven.toolchain < plexus.core
[DEBUG] Imported: org.apache.maven.usability < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG] Imported: org.codehaus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.* < plexus.core
[DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.component < plexus.core
[DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG] Imported: org.codehaus.plexus.container < plexus.core
[DEBUG] Imported: org.codehaus.plexus.context < plexus.core
[DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG] Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG] Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG] Imported: org.eclipse.aether.* < plexus.core
[DEBUG] Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG] Imported: org.eclipse.aether.collection < plexus.core
[DEBUG] Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG] Imported: org.eclipse.aether.graph < plexus.core
[DEBUG] Imported: org.eclipse.aether.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.installation < plexus.core
[DEBUG] Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG] Imported: org.eclipse.aether.repository < plexus.core
[DEBUG] Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG] Imported: org.eclipse.aether.spi < plexus.core
[DEBUG] Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG] Imported: org.eclipse.aether.version < plexus.core
[DEBUG] Imported: org.slf4j.* < plexus.core
[DEBUG] Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from E:\apache-maven-3.3.3\conf\settings.xml
[DEBUG] Reading user settings from D:\.m2\settings.xml
[DEBUG] Reading global toolchains from E:\apache-maven-3.3.3\conf\toolchains.xml
[DEBUG] Reading user toolchains from D:\.m2\toolchains.xml
[DEBUG] Using local repository at C:\Users\Administrator\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\Administrator\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix archetype from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.apache.maven.plugins/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix archetype to org.apache.maven.plugins:maven-archetype-plugin from repository central
[DEBUG] Resolving plugin version for org.apache.maven.plugins:maven-archetype-plugin
[DEBUG] Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Resolved plugin version for org.apache.maven.plugins:maven-archetype-plugin to 2.2 from repository central (https://repo.maven.apache.org/maven2, default, releases)
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.apache.maven:standalone-pom:pom:1
[DEBUG] Tasks: [archetype:generate]
[DEBUG] Style: Aggregating
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[DEBUG] Resolving plugin prefix archetype from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.apache.maven.plugins/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Resolved plugin prefix archetype to org.apache.maven.plugins:maven-archetype-plugin from repository central
[DEBUG] Resolving plugin version for org.apache.maven.plugins:maven-archetype-plugin
[DEBUG] Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local (C:\Users\Administrator\.m2\repository)
[DEBUG] Skipped remote request for org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Resolved plugin version for org.apache.maven.plugins:maven-archetype-plugin to 2.2 from repository central (https://repo.maven.apache.org/maven2, default, releases)
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project: org.apache.maven:standalone-pom:1
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins) : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] --- init fork of org.apache.maven:standalone-pom:1 for org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) ---
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] --- exit fork of org.apache.maven:standalone-pom:1 for org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) ---
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<archetypeArtifactId>${archetypeArtifactId}</archetypeArtifactId>
<archetypeCatalog default-value="remote,local">${archetypeCatalog}</archetypeCatalog>
<archetypeGroupId>${archetypeGroupId}</archetypeGroupId>
<archetypeRepository>${archetypeRepository}</archetypeRepository>
<archetypeVersion>${archetypeVersion}</archetypeVersion>
<basedir>${basedir}</basedir>
<filter>${filter}</filter>
<goals>${goals}</goals>
<interactiveMode default-value="${settings.interactiveMode}">${interactiveMode}</interactiveMode>
<localRepository>${localRepository}</localRepository>
<remoteArtifactRepositories>${project.remoteArtifactRepositories}</remoteArtifactRepositories>
<session>${session}</session>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=110, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=49, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=7, ConflictResolver.conflictItemCount=104, DefaultDependencyCollector.collectTime=149, DefaultDependencyCollector.transformTime=10}
[DEBUG] org.apache.maven.plugins:maven-archetype-plugin:jar:2.2:
[DEBUG] org.apache.maven.archetype:archetype-catalog:jar:2.2:compile
[DEBUG] org.apache.maven.archetype:archetype-descriptor:jar:2.2:compile
[DEBUG] org.apache.maven.archetype:archetype-registry:jar:2.2:compile
[DEBUG] org.apache.maven.archetype:archetype-common:jar:2.2:compile
[DEBUG] net.sourceforge.jchardet:jchardet:jar:1.0:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG] dom4j:dom4j:jar:1.6.1:compile
[DEBUG] xml-apis:xml-apis:jar:1.0.b2:compile
[DEBUG] jdom:jdom:jar:1.0:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.8:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:4.8.2:test
[DEBUG] commons-io:commons-io:jar:1.4:compile
[DEBUG] org.codehaus.plexus:plexus-velocity:jar:1.1.8:compile
[DEBUG] org.apache.velocity:velocity:jar:1.5:compile
[DEBUG] commons-lang:commons-lang:jar:2.1:compile
[DEBUG] oro:oro:jar:2.0.8:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.8:compile
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-core:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.8:compile
[DEBUG] org.apache.maven.reporting:maven-reporting-api:jar:2.0.8:compile
[DEBUG] org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-9:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-error-diagnostics:jar:2.0.8:compile
[DEBUG] commons-cli:commons-cli:jar:1.0:compile
[DEBUG] org.apache.maven:maven-plugin-descriptor:jar:2.0.8:compile
[DEBUG] org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-5:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.8:compile
[DEBUG] org.apache.maven:maven-monitor:jar:2.0.8:compile
[DEBUG] classworlds:classworlds:jar:1.1:compile
[DEBUG] org.apache.maven.shared:maven-invoker:jar:2.0.11:compile
[DEBUG] commons-collections:commons-collections:jar:3.2.1:compile
[DEBUG] org.codehaus.groovy:groovy:jar:1.8.3:compile
[DEBUG] antlr:antlr:jar:2.7.7:compile
[DEBUG] asm:asm:jar:3.2:compile
[DEBUG] asm:asm-commons:jar:3.2:compile
[DEBUG] asm:asm-util:jar:3.2:compile
[DEBUG] asm:asm-analysis:jar:3.2:compile
[DEBUG] asm:asm-tree:jar:3.2:compile
[DEBUG] org.beanshell:bsh:jar:2.0b4:compile
[DEBUG] org.apache.maven.shared:maven-script-interpreter:jar:1.0:compile
[DEBUG] org.apache.ant:ant:jar:1.8.1:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2
[DEBUG] Included: org.apache.maven.plugins:maven-archetype-plugin:jar:2.2
[DEBUG] Included: org.apache.maven.archetype:archetype-catalog:jar:2.2
[DEBUG] Included: org.apache.maven.archetype:archetype-descriptor:jar:2.2
[DEBUG] Included: org.apache.maven.archetype:archetype-registry:jar:2.2
[DEBUG] Included: org.apache.maven.archetype:archetype-common:jar:2.2
[DEBUG] Included: net.sourceforge.jchardet:jchardet:jar:1.0
[DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG] Included: dom4j:dom4j:jar:1.6.1
[DEBUG] Included: xml-apis:xml-apis:jar:1.0.b2
[DEBUG] Included: jdom:jdom:jar:1.0
[DEBUG] Included: commons-io:commons-io:jar:1.4
[DEBUG] Included: org.codehaus.plexus:plexus-velocity:jar:1.1.8
[DEBUG] Included: org.apache.velocity:velocity:jar:1.5
[DEBUG] Included: commons-lang:commons-lang:jar:2.1
[DEBUG] Included: oro:oro:jar:2.0.8
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.5.8
[DEBUG] Included: org.apache.maven.reporting:maven-reporting-api:jar:2.0.8
[DEBUG] Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-9
[DEBUG] Included: commons-cli:commons-cli:jar:1.0
[DEBUG] Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-5
[DEBUG] Included: org.apache.maven.shared:maven-invoker:jar:2.0.11
[DEBUG] Included: commons-collections:commons-collections:jar:3.2.1
[DEBUG] Included: org.codehaus.groovy:groovy:jar:1.8.3
[DEBUG] Included: antlr:antlr:jar:2.7.7
[DEBUG] Included: asm:asm:jar:3.2
[DEBUG] Included: asm:asm-commons:jar:3.2
[DEBUG] Included: asm:asm-util:jar:3.2
[DEBUG] Included: asm:asm-analysis:jar:3.2
[DEBUG] Included: asm:asm-tree:jar:3.2
[DEBUG] Included: org.beanshell:bsh:jar:2.0b4
[DEBUG] Included: org.apache.maven.shared:maven-script-interpreter:jar:1.0
[DEBUG] Included: org.apache.ant:ant:jar:1.8.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-archetype-plugin:2.2:generate from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-archetype-plugin:2.2, parent: sun.misc.Launcher$AppClassLoader@3e0ebb]
[DEBUG] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[DEBUG] Setting property: site.resource.loader.class => 'org.codehaus.plexus.velocity.SiteResourceLoader'.
[DEBUG] Setting property: velocimacro.messages.on => 'false'.
[DEBUG] Setting property: resource.loader => 'classpath,site'.
[DEBUG] Setting property: runtime.log.invalid.references => 'false'.
[DEBUG] Setting property: resource.manager.logwhenfound => 'false'.
[DEBUG] *******************************************************************
[DEBUG] Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29)
[DEBUG] RuntimeInstance initializing.
[DEBUG] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
[DEBUG] LogSystem has been deprecated. Please use a LogChute implementation.
[DEBUG] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[DEBUG] ResourceLoader instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[DEBUG] ResourceLoader instantiated: org.codehaus.plexus.velocity.SiteResourceLoader
[DEBUG] ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[DEBUG] Default ResourceManager initialization complete.
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[DEBUG] Created '20' parsers.
[DEBUG] Velocimacro : initialization starting.
[DEBUG] Velocimacro : allowInline = true : VMs can be defined inline in templates
[DEBUG] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[DEBUG] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[DEBUG] Velocimacro : autoload off : VM system will not automatically reload global library macros
[DEBUG] Velocimacro : Velocimacro : initialization complete.
[DEBUG] RuntimeInstance successfully initialized.
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-archetype-plugin:2.2:generate' with basic configurator -->
[DEBUG] (f) archetypeCatalog = local
[DEBUG] (f) basedir = C:\sts-bundle\workspace\test
[DEBUG] (f) interactiveMode = true
[DEBUG] (f) localRepository = id: local
url: file:///C:/Users/Administrator/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) remoteArtifactRepositories = [ id: central
url: https://repo.maven.apache.org/maven2
layout: default
snapshots: [enabled => false, update => daily]
releases: [enabled => true, update => daily]
]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@df2888
[DEBUG] -- end configuration --
[INFO] Generating project in Interactive mode
[DEBUG] Using catalog D:\.m2\archetype-catalog.xml
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
Your filter doesn't match any archetype (hint: enter to return to initial list)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains):
I remembered that I had changed my window 7's Destop default path when I saw the follwing messages:
[DEBUG] Reading global settings from E:\apache-maven-3.3.3\conf\settings.xml
[DEBUG] Reading user settings from D:\.m2\settings.xml
[DEBUG] Reading global toolchains from E:\apache-maven-3.3.3\conf\toolchains.xml
[DEBUG] Reading user toolchains from D:\.m2\toolchains.xml
[DEBUG] Using local repository at C:\Users\Administrator\.m2\repository
...
[DEBUG] Using catalog D:\.m2\archetype-catalog.xml
Maven's localRepository is "${user.home}/.m2/repository".Although I set
<localRepository>C:\Users\Administrator\.m2\repository</localRepository>
in "E:\apache-maven-3.3.3\conf\settings.xml" and "C:\Users\Administrator\.m2\settings.xml",user.home has not changed and remain "D:\".
system environment variable user.home's path is user.destop's parent path.
open the registry,find the " HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",I find the Desktop's path is "D:\Desktop",so the user.home's path is "D:\" now.
I update the localRepository to <localRepository>${user.home}/.m2/repository</localRepository>
and copy the C:\Users\Administrator\.m2 directory to d:\ .
C:\sts-bundle\workspace\test>mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom ---
[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: local -> dfr.custom.archetypes:archetype_webapp-archetype (archetype_webapp)
2: local -> org.apache.maven.archetypes:maven-archetype-plugin (plugin)
3: local -> org.apache.maven.archetypes:maven-archetype-quickstart (quickstart)
4: local -> org.apache.maven.archetypes:maven-archetype-webapp (webapp)
5: local -> org.apache.struts:struts2-archetype-blank (struts2-archetype-blank)
6: local -> org.codehaus.mojo.archetypes:webapp-javaee6 (JavaEE6 web application archetype)
7: local -> org.jboss.archetype.wfk:jboss-spring-mvc-archetype (getting-started)
8: local -> org.jboss.spec.archetypes:jboss-javaee6-webapp-archetype (jboss-javaee6-webapp-src)
9: local -> org.jboss.spring.archetypes:spring-mvc-webapp (getting-started)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 3: