DefaultExternalProjectDependency (ResolvedComponentResult componentResult, String projectPath, Configuration it) { String name = componentResult.getModuleVersion().getName(); String group = componentResult.getModuleVersion().getGroup(); String version = componentResult.getModuleVersion().getVersion(); ComponentSelectionReason reason = componentResult.getSelectionReason(); Object description = invokeMethod(reason, "getDescription"); String selectionReason = description == null ? "" : description.toString(); DefaultExternalProjectDependency dependency = new DefaultExternalProjectDependency(); dependency.setName(name); dependency.setGroup(group); dependency.setVersion(version); dependency.setScope(scope); dependency.setSelectionReason(selectionReason); dependency.setProjectPath(projectPath); dependency.setConfigurationName(it.getName()); Set<File> artifactsFiles = new LinkedHashSet<>(it.getAllArtifacts().getFiles().getFiles()); dependency.setProjectDependencyArtifacts(artifactsFiles); GradleSourceSetCachedFinder sourceSetFinder = GradleSourceSetCachedFinder.getInstance(myContext); dependency.setProjectDependencyArtifactsSources(sourceSetFinder.findArtifactSources(artifactsFiles)); if (it.getArtifacts().size() == 1) { PublishArtifact publishArtifact = it.getAllArtifacts().iterator().next(); dependency.setClassifier(publishArtifact.getClassifier()); dependency.setPackaging(publishArtifact.getExtension()); } return dependency; }