Jetty启动缓慢,类路径中包含BouncyCastle

Jetty启动缓慢,类路径中包含BouncyCastle,jetty,bouncycastle,Jetty,Bouncycastle,我正在使用jetty-maven-plugin作为maven项目中的一个插件。插件在2-4秒内启动,但当我将org.bouncycastle:bcprov-jdk15on:1.52作为依赖项包含进来时,启动时间增加到35-60秒。背景中发生了什么?我如何解决这个问题?我终于可以通过在jetty web.xml中排除BC来避免不必要的扫描: <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call n

我正在使用
jetty-maven-plugin
作为maven项目中的一个插件。插件在2-4秒内启动,但当我将org.bouncycastle:bcprov-jdk15on:1.52作为依赖项包含进来时,启动时间增加到35-60秒。背景中发生了什么?我如何解决这个问题?

我终于可以通过在jetty web.xml中排除BC来避免不必要的扫描:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Call name="setAttribute">
        <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
        <Arg>^((?!bcprov).)*$</Arg>
    </Call>
</Configure>

org.eclipse.jetty.server.webapp.webinIncludeJarPattern
^((?!bcprov)。)*$
使用插件配置:

<contextXml>src/main/webapp/WEB-INF/jetty-web.xml</contextXml>
src/main/webapp/WEB-INF/jetty-WEB.xml

我最终可以通过将BC排除在jetty web.xml中来避免不必要的扫描:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Call name="setAttribute">
        <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
        <Arg>^((?!bcprov).)*$</Arg>
    </Call>
</Configure>

org.eclipse.jetty.server.webapp.webinIncludeJarPattern
^((?!bcprov)。)*$
使用插件配置:

<contextXml>src/main/webapp/WEB-INF/jetty-web.xml</contextXml>
src/main/webapp/WEB-INF/jetty-WEB.xml

web.xml中的这一添加解决了我启动缓慢的问题

    <absolute-ordering>
        <name>dummy</name>
    </absolute-ordering>

笨蛋

web.xml中的这一添加解决了我启动缓慢的问题

    <absolute-ordering>
        <name>dummy</name>
    </absolute-ordering>

笨蛋

有趣的是,tomcat7 maven pluginprobably classpath scanning relatedmetadata complete=true in web.xml没有帮助。
metadata complete
对Servlet 3.x中的扫描是/否没有任何意义-必须扫描所有类以确保合规性。tomcat7还实现了Servlet 3.0规范,但不会花那么长时间。有趣的是,tomcat7 maven pluginprobably classpath scanning relatedmetadata complete=true in web.xml没有帮助。
metadata complete
对Servlet 3.x中的扫描是/否没有任何意义-所有类都必须扫描以确保符合性。tomcat7还实现了Servlet 3.0规范,但不会花那么长时间。