http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
現在Jetty的版本已經到9了,也早已經在Eclipse的門下了。所以有很多groupId,比如:org.eclipse.jetty、org.mortbay.jetty.這些都可以用的哦。
我在使用MyEclipse結合maven操作jetty作為開發的伺服器,這開開發比較方便。
當我執行命令:
jetty:run
出現:
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (F:\Java\maven\repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
這樣的問題,其實就是說,maven不知道這個外掛在哪裡,所以我們需要配置或者加引數。
解決:
方法1:
執行的時候是這樣的:
mvn org.mortbay.jetty:maven-jetty-plugin:run
或:
mvn org.eclipse.jetty:maven-jetty-plugin:run
方法2:
在maven的配置檔案外掛組上新增外掛:
<pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
或:
<pluginGroups>
<pluginGroup>org.eclipse.jetty</pluginGroup>
</pluginGroups>
這樣就可以解決!