Maven的码头插件SSL配置问题 [英] Maven's jetty plugin SSL configuration issue
问题描述
我正在使用Jetty的Maven版本7.0.0.pre5的插件,但是在将其配置为具有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.
这是我pom.xml中插件的配置
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>
尝试使用mvn jetty:run运行它会显示以下输出:
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
使用org.mortbay.jetty.ssl.SslSocketConnector呈现相同的结果.
Using org.mortbay.jetty.ssl.SslSocketConnector renders the same result.
这真的很奇怪,因为根据Jetty自己的文档,这两个类都存在,并且这是它们的正确名称(请注意,在Jetty 6中使用了包安全性而不是ssl).
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).
推荐答案
不确定这是正常现象,但jetty-maven-plugin在pom中没有jetty-ssl
作为依赖项.因此,请像这样更新您的pom:
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:
<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>
<dependencies>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-ssl</artifactId>
<version>7.0.0.pre5</version>
</dependency>
</dependencies>
</plugin>
该插件将成功加载org.mortbay.jetty.ssl.SslSelectChannelConnector
.
这篇关于Maven的码头插件SSL配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!