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

[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啦


希望能幫助有同樣問題的朋友!!!