问题描述
在使用maven创建web时,在cmd下面输入如下命令:
mvn archetype:generate
-DgroupId=duan
-DartifactId=MyWebTest
-DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
然后发现在“Generating project in Batch mode”卡住。
查了一下发现原因是因为有部分需要下载的东西被墙了。
解决办法
更改maven的配置文件:
增加阿里的镜像,然后在cmd增加输入-DarchetypeCatalog=local这个命令。
也就是
mvn archetype:generate
-DgroupId=duan -DartifactId=MyWebTest
-DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
-DarchetypeCatalog=local
界面如下:
OK,问题解决。