private void setMavenParentProject(MavenProjectModel projectModel) { FileModel fileModel = projectModel.getRootFileModel(); if (fileModel == null) { // skip if no file was discovered for it return; } else if (fileModel instanceof ArchiveModel) { ArchiveModel archiveModel = (ArchiveModel) fileModel; // look at the parent archive first setParentProject(archiveModel.getParentArchive(), projectModel); } else { FileModel parentFile = fileModel.getParentFile(); setParentProject(parentFile, projectModel); } }
private void setParentProject(ArchiveModel archiveModel, MavenProjectModel projectModel) { if (archiveModel == null) { return; } else if (archiveModel.getProjectModel() != null) { String mavenGAV = projectModel.getGroupId() + ":" + projectModel.getArtifactId() + ":" + projectModel.getVersion(); String archivePath = archiveModel.getFilePath(); LOG.info("Setting parent project for: " + mavenGAV + " to: " + archivePath); projectModel.setParentProject(archiveModel.getProjectModel()); } else { setParentProject(archiveModel.getParentArchive(), projectModel); } }