Maven的jetty插件SSL配置问题
我正在使用 Jetty 的 Maven 插件,版本 7.0.0.pre5,但在将其配置为具有 SSL 连接器时遇到问题。每当我启动应用程序时,它都会失败,指出未找到请求的实现。
这是我的 pom.xml 中的插件配置
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.0.0.pre5</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
</connector>
<connector implementation="org.mortbay.jetty.ssl.SslSelectChannelConnector">
<port>8443</port>
<keystore>src/test/resources/server.keystore</keystore>
<keyPassword>123456</keyPassword>
<password>123456</password>
</connector>
</connectors>
</configuration>
</plugin>
尝试使用 mvn jetty:run 运行它会给出以下输出:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.pre5
Cause: Class name which was explicitly given in configuration using 'implementation' attribute: 'org.mortbay.jetty.ssl.SslSelectChannelConnector' cannot be loaded
使用 org.mortbay.jetty.ssl.SslSocketConnector 呈现相同的结果。
这真的很奇怪,因为根据 Jetty 自己的文档,这两个类都存在,并且这是它们的正确名称(请注意,在 Jetty 6 中使用了包安全性而不是 ssl)。
欢迎任何想法。
I'm using Jetty's plugin for Maven, version 7.0.0.pre5, but I have issues configuring it to have a SSL Connector. Whenever I start the application, it fails stating that the requested implementation is not found.
This is the plugin's configuration within my pom.xml
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.0.0.pre5</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
</connector>
<connector implementation="org.mortbay.jetty.ssl.SslSelectChannelConnector">
<port>8443</port>
<keystore>src/test/resources/server.keystore</keystore>
<keyPassword>123456</keyPassword>
<password>123456</password>
</connector>
</connectors>
</configuration>
</plugin>
Attempting to run it with mvn jetty:run gives the following output:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.pre5
Cause: Class name which was explicitly given in configuration using 'implementation' attribute: 'org.mortbay.jetty.ssl.SslSelectChannelConnector' cannot be loaded
Using org.mortbay.jetty.ssl.SslSocketConnector renders the same result.
It's really weird, since, according to Jetty's own documentation, both classes exists and that's their correct name (notice in Jetty 6 the package security was used instead of ssl).
Any ideas are welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于当前版本的 jetty-maven-plugin 8.0.0.M2,类名已移至 org.eclipse.* 中,并且不需要额外的依赖项。
请参阅:http://wiki.eclipse.org/Jetty/Starting/Porting_to_Jetty_7
For the current version of jetty-maven-plugin, 8.0.0.M2, the class names have been moved into org.eclipse.*, and no additional dependencies are needed.
See: http://wiki.eclipse.org/Jetty/Starting/Porting_to_Jetty_7
不确定这是否正常,但 jetty-maven-plugin 在其 pom.xml 中没有
jetty-ssl
作为依赖项。因此,请像这样更新你的pom:插件将成功加载
org.mortbay.jetty.ssl.SslSelectChannelConnector
。Not sure this is normal but the jetty-maven-plugin doesn't have
jetty-ssl
as dependency in its pom. So please update your pom like this:And the plugin will succeed to load
org.mortbay.jetty.ssl.SslSelectChannelConnector
.对于使用 Jetty 6.x 的任何人来说,要包含在插件依赖项中的工件是jetty-sslengine。
For anyone using Jetty 6.x, the artifact to include in the dependencies for the plugin is
jetty-sslengine
.实际上与 Pascal Thivent 的回答相同,并结合了 gnuf 答案,但有效(版本 6.1.26)。
Actually same as answered by Pascal Thivent with conjunction of an gnuf answer but valid one (ver. 6.1.26).