Пример #1
0
 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);
   }
 }
Пример #2
0
 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);
   }
 }