Maven 踩过的坑

Jetty 运行报错:

[INFO] ------------------------------------------------------------------------
[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 (C:\Users\HUI\.m2\repository), alimaven (http://maven.aliyun.com/nexus/content/groups/public/)] -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

解决方法:

在项目中pom.xml文件中添加以下代码

        <!-- 配置加入jetty服务器,开发时我们一般使用jetty服务器 -->
        <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <configuration>
            <webApp>
              <contextPath>/</contextPath>
            </webApp>
          </configuration>
        </plugin>

 

posted @ 2020-04-03 18:10  Hlikex  阅读(193)  评论(0编辑  收藏  举报