Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli)

  • Post author:
  • Post category:其他


[INFO] BUILD FAILURE

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project mavenhello: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run failed: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.2 -> org.apache.tomcat.maven:tomcat7-war-runner:jar:2.2 -> commons-cli:commons-cli:jar:1.2: Failed to read artifact descriptor for commons-cli:commons-cli:jar:1.2: Failure to find org.apache.commons:commons-parent:pom:11 in http://maven.aliyun.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced -> [Help 1]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

我刚使用maven的时候也出现了上诉办法,具体原因是阿里云仓库中没有这些jar包,此博主提供了一个解决办法:

木偶人的博客

问题虽然解决了,但是不方便的地方就出现了,都知道阿里云镜像目前是国内最快的,将之注释之后,导致我引用的jar包下载特别慢.

后来我发现原来,再次选项下

我使用的默认settings.xml,默认的里面只有tomcat6的服务器,没有tomcat7的服务器,接着往下看,下面来验证我的言论

进行tomcat7:run的命令时

所以只需要下面的步骤就行了;还是继续使用阿里云仓库,再使用的话就指向我们自定义的settings.xml啦


希望能帮助有同样问题的朋友!!!



版权声明:本文为wf124198原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。