public CompilationTask getTask()

in src/main/java/org/apache/maven/plugin/compiler/ForkedCompiler.java [59:102]


    public CompilationTask getTask(
            Writer out,
            JavaFileManager fileManager,
            DiagnosticListener<? super JavaFileObject> diagnosticListener,
            Iterable<String> options,
            Iterable<String> classes,
            Iterable<? extends JavaFileObject> compilationUnits) {
        return new CompilationTask() {
            /**
             * Adds root modules to be taken into account during module resolution.
             * Currently ignored, caller should use compiler options instead.
             */
            @Override
            public void addModules(Iterable<String> moduleNames) {}

            /**
             * Sets processors for annotation processing, bypassing the normal discovery mechanism.
             * Ignored because we cannot pass an instance of a Java object to a command-line.
             */
            @Override
            public void setProcessors(Iterable<? extends Processor> processors) {}

            /**
             * Sets the locale to be applied when formatting diagnostics and other localized data.
             * Currently ignored.
             */
            @Override
            public void setLocale(Locale locale) {}

            /**
             * Performs this compilation task.
             *
             * @return true if all the files compiled without errors
             */
            @Override
            public Boolean call() {
                try {
                    return run(out, (ForkedToolSources) fileManager, options, compilationUnits);
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
        };
    }