ProcessorConfigProfile (Module module, MavenProject mavenProject, CompilerConfigurationImpl compilerConfiguration, String moduleProfileName, boolean outputRelativeToContentRoot, String annotationProcessorDirectory, String testAnnotationProcessorDirectory) { ProcessorConfigProfile moduleProfile = compilerConfiguration.findModuleProcessorProfile(moduleProfileName); if (moduleProfile == null) { moduleProfile = new ProcessorConfigProfileImpl(moduleProfileName); moduleProfile.setEnabled(true); compilerConfiguration.addModuleProcessorProfile(moduleProfile); } if (!moduleProfile.isEnabled()) return null; moduleProfile.setObtainProcessorsFromClasspath(true); moduleProfile.setOutputRelativeToContentRoot(outputRelativeToContentRoot); moduleProfile.setGeneratedSourcesDirectoryName(annotationProcessorDirectory, false); moduleProfile.setGeneratedSourcesDirectoryName(testAnnotationProcessorDirectory, true); moduleProfile.clearProcessorOptions(); for (Map.Entry<String, String> entry : mavenProject.getAnnotationProcessorOptions().entrySet()) { moduleProfile.setOption(entry.getKey(), entry.getValue()); } moduleProfile.clearProcessors(); final List<String> processors = mavenProject.getDeclaredAnnotationProcessors(); if (processors != null) { for (String processor : processors) { moduleProfile.addProcessor(processor); } } moduleProfile.addModuleName(module.getName()); return moduleProfile; }