code: @Override
      public void processEvent(SystemEvent event) throws AbortProcessingException {
          final UIViewRoot source = (UIViewRoot) event.getSource();
  
          final FacesContext context = FacesContext.getCurrentInstance();
          final WebXmlParameters webXmlParameters = new WebXmlParameters(context.getExternalContext());
          final boolean provideJQuery = webXmlParameters.isProvideJQuery();
          final boolean provideBootstrap = webXmlParameters.isProvideBoostrap();
          final boolean useCompressedResources = webXmlParameters.isUseCompressedResources();
          final boolean disablePrimeFacesJQuery = webXmlParameters.isIntegrationPrimeFacesDisableJQuery();
  
          final List<UIComponent> resources = new ArrayList<>(source.getComponentResources(context, HEAD));
          // Production mode and compressed
          if (useCompressedResources && context.getApplication().getProjectStage() == ProjectStage.Production) {
              handleCompressedResources(context, provideJQuery, provideBootstrap, resources, source);
          } else {
              handleConfigurableResources(context, provideJQuery, provideBootstrap, resources, source);
          }
  
          if (disablePrimeFacesJQuery) {
              for (UIComponent resource : resources) {
                  final String resourceLibrary = (String) resource.getAttributes().get("library");
                  final String resourceName = (String) resource.getAttributes().get("name");
                  if ("primefaces".equals(resourceLibrary) && "jquery/jquery.js".equals(resourceName)) {
                      source.removeComponentResource(context, resource);
                  }
              }
          }
      }
docs: Process event. Just the first time.