{"record":{"id":"c7ebb9211c83315d","repo":"elastic/elasticsearch","slug":"elasticsearch-standalone-test-elasticsearch-stand","errorCode":null,"errorMessage":"elasticsearch.standalone-test, elasticsearch.standalone-rest-test, and elasticsearch.build are mutually exclusive","messagePattern":"elasticsearch\\.standalone-test, elasticsearch\\.standalone-rest-test, and elasticsearch\\.build are mutually exclusive","errorType":"exception","errorClass":"InvalidUserDataException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java","lineNumber":57,"sourceCode":"    private final BuildLayout buildLayout;\n    private final ObjectFactory objectFactory;\n    private final ProviderFactory providerFactory;\n    private final ProjectLayout projectLayout;\n\n    @Inject\n    BuildPlugin(BuildLayout buildLayout, ObjectFactory objectFactory, ProviderFactory providerFactory, ProjectLayout projectLayout) {\n        this.buildLayout = buildLayout;\n        this.objectFactory = objectFactory;\n        this.providerFactory = providerFactory;\n        this.projectLayout = projectLayout;\n    }\n\n    @Override\n    public void apply(final Project project) {\n        // make sure the global build info plugin is applied to the root project\n        project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class);\n        if (project.getPluginManager().hasPlugin(\"elasticsearch.standalone-rest-test\")) {\n            throw new InvalidUserDataException(\n                \"elasticsearch.standalone-test, \" + \"elasticsearch.standalone-rest-test, and elasticsearch.build are mutually exclusive\"\n            );\n        }\n\n        project.getPluginManager().apply(\"elasticsearch.java\");\n        project.getPluginManager().apply(ElasticsearchJavadocPlugin.class);\n        project.getPluginManager().apply(DependenciesInfoPlugin.class);\n        project.getPluginManager().apply(LicensingPlugin.class);\n        project.getPluginManager().apply(SnykDependencyMonitoringGradlePlugin.class);\n        project.getPluginManager().apply(ClusterFeaturesMetadataPlugin.class);\n        InternalPrecommitTasks.create(project, true);\n        configureLicenseAndNotice(project);\n    }\n\n    public void configureLicenseAndNotice(final Project project) {\n        final ExtraPropertiesExtension ext = project.getExtensions().getByType(ExtraPropertiesExtension.class);\n        RegularFileProperty licenseFileProperty = objectFactory.fileProperty();\n        RegularFileProperty noticeFileProperty = objectFactory.fileProperty();","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java#L39-L75","documentation":"Thrown by BuildPlugin.apply (the elasticsearch.build plugin) when elasticsearch.standalone-rest-test is already applied to the same project. The three plugin families - elasticsearch.build, elasticsearch.standalone-test, and elasticsearch.standalone-rest-test - are mutually exclusive because each fully configures a project for a different purpose; mixing them double-configures the project.","triggerScenarios":"Applying apply plugin: 'elasticsearch.build' to a project whose build.gradle already contains apply plugin: 'elasticsearch.standalone-rest-test' (or standalone-test).","commonSituations":"Copy-pasting a plugin block from a server subproject into a test subproject; misclassifying whether a module is a main build, standalone test, or REST test.","solutions":["Remove the conflicting plugin apply so only one of the three is present.","Decide the module type: production code -> elasticsearch.build; standalone JVM tests -> standalone-test; REST test -> standalone-rest-test.","Check for transitive plugin application via a convention plugin that pulls in both."],"exampleFix":"// before\napply plugin: 'elasticsearch.standalone-rest-test'\napply plugin: 'elasticsearch.build'\n// after\napply plugin: 'elasticsearch.build'","handlingStrategy":"validation","validationCode":"if (project.getPluginManager().hasPlugin(\"elasticsearch.standalone-rest-test\")) {\n    throw new InvalidUserDataException(\n        \"elasticsearch.standalone-test, elasticsearch.standalone-rest-test, and elasticsearch.build are mutually exclusive\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply exactly one of the three project-type plugins per module.","Document which module types use which plugin to prevent copy-paste errors.","Audit convention plugins to ensure they do not transitively pull a conflicting plugin."],"tags":["gradle","plugin-conflict","configuration-time","build-tools"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}