In Maven's five-minute primer, there is a command:
archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
The command of this sentence is to create a default project, but when I execute this command, the command line stops at
in Batch mode
This sentence will stop for a long time. "Of course, there are people in the past." 】
Add an-x parameter to see more information
archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -X
As you can see, the program stops at the following line.
for remote catalog: http://repo1.maven.org/maven2/archetype-catalog.xml
To query this file when the network is poor or other reasons, resulting in hanging there.
The workaround is simple.
1. 把上述地址复制到浏览器中,下载这个文件到本地。2. 把文件archetype-catalog.xml复制到目录.m2\repository\org\apache\maven\archetype\archetype-catalog\2.2下面。3. 在上述命令后增加参数-DarchetypeCatalog=local,变成读取本地文件即可。
4. With the company VPN, you can quickly download to the required dependent files.
Maven "Generating project in Batch mode" problem Resolution (GO)