错误信息如下:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.611 s
[INFO] Finished at: 2014-03-21T18:17:04+08:00
[INFO] Final Memory: 8M/14M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:8.1.14.v20131031:
run (default-cli) on project assai: Unable to parse configuration of mojo
org.mortbay.jetty:jetty-maven-plugin:8.1.14.v20131031:run for parameter connectors:
Cannot load implementation hint 'org.mortbay.jetty.nio.SelectChannelConnector' -> [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/PluginConfigurationException
pom配置为:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <webDefaultXml>${basedir}/${webapp}/src/main/resources/jetty/webdefault.xml</webDefaultXml> <scanIntervalSeconds>10</scanIntervalSeconds> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> <connectors> <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> <port>8088</port> </connector> </connectors> </configuration> </plugin>
错误原因,不小心把version 标签删掉了,结果默认用了最新版8.1.14.v20131031,从7.0.0.1beta3开始SelectChannelConnector就改到了org.eclipse.jetty.server.nio.SelectChannelConnector
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> 改为 <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">一切正常
后来发现配置项变动的还不少呢,官方实例有说明
<project>
...
<plugins>
...
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<!-- Configure the webapp -->
<contextPath>/biggerstrongerbetterfaster</contextPath>
<tmpDir>target/not/necessary</tmpDir>
<webDefaultXml>
src/main/resources/webdefault.xml
</webDefaultXml>
<overrideWebXml>
src/main/resources/override-web.xml
</overrideWebXml>
<!-- OR, as of jetty6.1.6rc0, you can use the webAppConfig element instead -->
<webAppConfig>
<contextPath>/test</contextPath>
<tempDirectory>
${project.build.directory}/work
</tempDirectory>
<defaultsDescriptor>
src/main/resources/webdefault.xml
</defaultsDescriptor>
<overrideDescriptor>
src/main/resources/override-web.xml
</overrideDescriptor>
</webAppConfig>
<!-- configure the container -->
...
</configuration>
</plugin>
</plugins>
</project>
我说杂webDefaultXml都失效了呢