How to enable CachingWebAppClassLoader in Jetty Maven plugin?

I am trying to improve the performance of running a Java web application in a development environment. It uses plugty-maven-plugin and is mvn jetty:runused to run the application.

I followed the instructions http://www.eclipse.org/jetty/documentation/9.3.x/jetty-classloading.html to register this new one CachingWebAppClassLoader.

<Configure id="mywebapp" class="org.eclipse.jetty.webapp.WebAppContext">

...

  <Set name="classLoader">
    <New class="org.eclipse.jetty.webapp.CachingWebAppClassLoader">
      <Arg><Ref refid="mywebapp"/></Arg>
    </New>
  </Set>

...
</Configure>

However, org.eclipse.jetty.webapp.WebAppClassLoader.*continued to appear in jplvvvmv but notCachingWebAppClassLoader

I confirmed that my registration of the class loader was at least detected by providing an invalid class name, in which case it ClassNotFoundExceptionwas selected. I assume that my classloader configuration is being consumed, but not used or something like that. Any ideas?

, , , .

+6
1

jetty-maven-plugin WebAppContext, JettyWebAppContext:

JettyWebAppContext WebAppContext, maven.

, WebAppContext jetty.xml , .

WebApplicationContext org.eclipse.jetty.maven.plugin.JettyWebAppContext jetty.xml, , , :

jetty.xml, webapp jetty.xml, maven , webapp. , webapp jetty.xml .

classLoader JettyWebAppContext pom.xml, webApp, :

<webApp>         
    <classLoader>org.eclipse.jetty.webapp.CachingWebAppClassLoader</classLoader>
</webApp>  

, , CachingWebAppClassLoader WebAppClassLoader.Context, .

, - (, contextHandler), , , , , jetty-maven-plugin:

in-situ Maven , , .

...

, . , IDE , -, , , .

, .

+3

Source: https://habr.com/ru/post/1016304/


All Articles