maven jetty配置

etty 是一个用 Java 实现、开源、基于标准的,并且具有丰富功能的 Http 服务器和 Web 容器,可以免费的用于商业行为。Jetty 这个项目成立于 1995 年,现在已经有非常多的成功产品基于 Jetty,比如 Apache Geromino, JBoss, IBM Tivoli, Cisco SESM 等。Jetty 可以用来作为一个传统的 Web 服务器,也可以作为一个动态的内容服务器,并且 Jetty 可以非常容易的嵌入到 Java 应用程序当中。

在按照这个网址http://www.ibm.com/developerworks/cn/web/tutorials/wa-aj-comet/section3.html启动lift项目运行时,抛出这个错误

[ERROR] No plugin found for prefix 'jetty' in the current project and in the plu
gin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repo
sitories [local (D:apache-maven-3.0
epository), nexus (http://localhost:8081/n
exus/content/groups/snapshot), Nexus (http://localhost:8081/nexus/content/groups
/public)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException

2.settings.xml 

      <pluginGroups>
                   <pluginGroup>org.mortbay.jetty</pluginGroup>
              </pluginGroups> 
    <activeProfiles>
        <activeProfile>nexus-local</activeProfile>
    </activeProfiles>
</settings>

注意pluginGroups的相对位置,是在</settings>之上的

最后在项目project下启动

$ mvn jetty:run

一切正常

原文地址:https://www.cnblogs.com/sophiading/p/4173619.html