AttachedJarDependency (@NotNull MavenProject mavenproject, @NotNull DependencyScope scope, @NotNull MavenArtifact artifact) { Element buildHelperCfg = mavenproject.getPluginGoalConfiguration("org.codehaus.mojo", "build-helper-maven-plugin", "attach-artifact"); if (buildHelperCfg == null) return null; var roots = new ArrayList<Pair<String, LibraryRootTypeId>>(); var create = false; for (Element artifactsElement : buildHelperCfg.getChildren("artifacts")) { for (Element artifactElement : artifactsElement.getChildren("artifact")) { String typeString = artifactElement.getChildTextTrim("type"); if (typeString != null && !typeString.equals("jar")) continue; String filePath = artifactElement.getChildTextTrim("file"); if (StringUtil.isEmpty(filePath)) continue; String classifier = artifactElement.getChildTextTrim("classifier"); if ("sources".equals(classifier)) { roots.add(new Pair<>(filePath, LibraryRootTypeId.Companion.getSOURCES())); } else if ("javadoc".equals(classifier)) { roots.add(new Pair<>(filePath, WorkspaceModuleImporter.Companion.getJAVADOC_TYPE())); } else { roots.add(new Pair<>(filePath, LibraryRootTypeId.Companion.getCOMPILED())); } create = true; } } return create ? new AttachedJarDependency(getAttachedJarsLibName(artifact), roots, scope) : null; }