/**
   * Retrieves dependency information from Spring XML configuration files in a Maven project.
   *
   * @param project the project to analyze
   * @param dependentClasses A set of classes that already had their dependencies analyzed. This
   *     method will <b>ADD</b> all Spring-induced dependencies to this set and also use it to
   *     determine whether a given class needs to have it's dependencies analyzed.
   * @throws Exception
   */
  public void addSpringDependencyClasses(MavenProject project, final Set<String> dependentClasses)
      throws Exception {
    final SpringFileBeanVisitor beanVisitor =
        new DefaultSpringXmlBeanVisitor(this.resolver, dependentClasses);

    for (File springXml : fileLocator.locateSpringXmls(project)) {
      final BufferedInputStream in = new BufferedInputStream(new FileInputStream(springXml));
      try {
        fileParser.parse(in, beanVisitor);
        if (log != null && log.isInfoEnabled()) {
          log.info("Scanned Spring XML " + springXml.getPath());
        }
      } catch (NoSpringXmlException ex) {
        if (log != null && log.isDebugEnabled()) {
          log.debug("Not a Spring XML file : " + springXml.getPath());
        }
        // ok
      } catch (Exception e) {
        if (log != null) {
          log.error("Failed to parse Spring XML " + springXml.getPath() + " ...", e);
        }
        throw e;
      } finally {
        in.close();
      }
    }
  }
コード例 #2
0
  @Override
  public void forkedProjectStarted(ExecutionEvent event) {
    if (logger.isInfoEnabled() && event.getMojoExecution().getForkedExecutions().size() > 1) {
      logger.info(chars(' ', LINE_LENGTH));
      logger.info(chars('>', LINE_LENGTH));

      logger.info(
          "Forking " + event.getProject().getName() + " " + event.getProject().getVersion());

      logger.info(chars('>', LINE_LENGTH));
    }
  }
コード例 #3
0
  @Override
  public void projectStarted(ExecutionEvent event) {
    if (logger.isInfoEnabled()) {
      logger.info(chars(' ', LINE_LENGTH));
      logger.info(chars('-', LINE_LENGTH));

      logger.info(
          "Building " + event.getProject().getName() + " " + event.getProject().getVersion());

      logger.info(chars('-', LINE_LENGTH));
    }
  }
コード例 #4
0
  @Override
  public void projectSkipped(ExecutionEvent event) {
    if (logger.isInfoEnabled()) {
      logger.info(chars(' ', LINE_LENGTH));
      logger.info(chars('-', LINE_LENGTH));

      logger.info("Skipping " + event.getProject().getName());
      logger.info("This project has been banned from the build due to previous failures.");

      logger.info(chars('-', LINE_LENGTH));
    }
  }
コード例 #5
0
  @Override
  public void sessionStarted(ExecutionEvent event) {
    if (logger.isInfoEnabled() && event.getSession().getProjects().size() > 1) {
      logger.info(chars('-', LINE_LENGTH));

      logger.info("Reactor Build Order:");

      logger.info("");

      for (MavenProject project : event.getSession().getProjects()) {
        logger.info(project.getName());
      }
    }
  }
コード例 #6
0
  @Override
  public void forkSucceeded(ExecutionEvent event) {
    if (logger.isInfoEnabled()) {
      StringBuilder buffer = new StringBuilder(128);

      buffer.append("<<< ");
      append(buffer, event.getMojoExecution());
      append(buffer, event.getProject());
      buffer.append(" <<<");

      logger.info("");
      logger.info(buffer.toString());
    }
  }
コード例 #7
0
  @Override
  public void sessionEnded(ExecutionEvent event) {
    if (logger.isInfoEnabled()) {
      if (event.getSession().getProjects().size() > 1) {
        logReactorSummary(event.getSession());
      }

      logResult(event.getSession());

      logStats(event.getSession());

      logger.info(chars('-', LINE_LENGTH));
    }
  }
コード例 #8
0
 @Override
 public void projectDiscoveryStarted(ExecutionEvent event) {
   if (logger.isInfoEnabled()) {
     logger.info("Scanning for projects...");
   }
 }