private void initServletContext()

in src/main/java/org/apache/sling/maven/jspc/JspcMojo.java [519:546]


    private void initServletContext() throws IOException, DependencyResolutionRequiredException {
        if (loader == null) {
            initClassLoader();
        }



        tldLocationsCache = featureSupport != null ? featureSupport.getTldLocationsCache() : new JspCTldLocationsCache(true, loader);

        context = new JspCServletContext(getLog(), new URL("file:" + uriSourceRoot.replace('\\', '/') + '/'), tldLocationsCache);
        for (File resourceDir: resourceDirectories) {
            String root = resourceDir.getCanonicalPath().replace('\\', '/');
            URL altUrl = new URL("file:" + root + "/");
            context.addAlternativeBaseURL(altUrl);
        }


        if (tldLocationsCache instanceof JspCTldLocationsCache) {
            ((JspCTldLocationsCache) tldLocationsCache).init(context);
        }

        JavaCompiler compiler = new EclipseJavaCompiler();
        ClassLoaderWriter writer = new JspCClassLoaderWriter(loader, new File(outputDirectory));
        ioProvider = new JspCIOProvider(loader, compiler, writer);
        rctxt = new JspRuntimeContext(context, this, ioProvider);
        jspConfig = new JspConfig(context);
        tagPluginManager = new TagPluginManager(context);
    }