2

码头 9.0.0.RC0

我在通过 Maven 正确配置我的码头服务时遇到问题。

目前我有

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
    <contextHandlers>
        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
            <war>../dataProvider/target/dataProvider-${project.version}.war</war>
            <contextPath>/dataProvider</contextPath>
        </contextHandler>
    </contextHandlers>
    <webAppConfig>
        <contextPath>/</contextPath>
        <baseResource
                implementation="org.eclipse.jetty.util.resource.ResourceCollection">
            <resourcesAsCSV>src/main/webapp,src/main/javascript,
                target/closure</resourcesAsCSV>
        </baseResource>
        <defaultsDescriptor>src/main/resources/jetty/webdefault.xml</defaultsDescriptor>
    </webAppConfig>
    <jettyXml>src/main/resources/jetty/jetty.xml</jettyXml>
    </configuration>
</plugin>

在我的 pom 和

<Configure id="Server" class="org.eclipse.jetty.server.Server">

    <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
        <Set name="KeyStorePath"><Property name="jetty.home" default="." />src/test/resources/keystore</Set>
        <Set name="KeyStorePassword">password</Set>
        <Set name="KeyManagerPassword">password</Set>
        <Set name="TrustStorePath"><Property name="jetty.home" default="." />src/test/resources/keystore</Set>
        <Set name="TrustStorePassword">password</Set>
    </New>

    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server" /></Arg>
                <Arg name="factories">
                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
                        <Item>
                            <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                                <Arg name="config"><Ref refid="httpConfig" /></Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>
                <Set name="host"><Property name="jetty.host" /></Set>
                <Set name="port"><Property name="jetty.port" default="8080" /></Set>
                <Set name="idleTimeout">30000</Set>
            </New>
        </Arg>
    </Call>

    <Call id="sslConnector" name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server" /></Arg>
                <Arg name="factories">
                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
                        <Item>
                            <New class="org.eclipse.jetty.server.SslConnectionFactory">
                                <Arg name="next">http/1.1</Arg>
                                <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>
                <Set name="host"><Property name="jetty.host" /></Set>
                <Set name="port"><Property name="jetty.tls.port" default="8443" /></Set>
                <Set name="idleTimeout">30000</Set>
            </New>
        </Arg>
    </Call>
</Configure>

在码头。我猜它在做一些疯狂的事情并将 https 服务暴露为 http 错误请求并失败,但我不知道为什么。调试非常困难,所以我很好奇是否有其他人让它工作?

4

0 回答 0