diff --git a/common/src/main/java/net/neoforged/gradle/common/extensions/IdeManagementExtension.java b/common/src/main/java/net/neoforged/gradle/common/extensions/IdeManagementExtension.java index 13347251d..4737365e2 100644 --- a/common/src/main/java/net/neoforged/gradle/common/extensions/IdeManagementExtension.java +++ b/common/src/main/java/net/neoforged/gradle/common/extensions/IdeManagementExtension.java @@ -38,6 +38,14 @@ public IdeManagementExtension(Project project) { if (!rootProject.getPlugins().hasPlugin(EclipsePlugin.class)) rootProject.getPlugins().apply(EclipsePlugin.class); } + + // Always pre-create the idePostSync task if IntelliJ is importing the project, since + // IntelliJ remembers to run the task post-sync even if the import fails. That will cause + // situations where import errors (i.e. dependency resolution errors) will be masked by + // the failed idePostSync task, since it was never created in that particular import. + if (isIdeaImport()) { + getOrCreateIdeImportTask(); + } } /**