Пример #1
0
 private MavenProject getTestSuite(String symbolicName) {
   for (MavenProject otherProject : session.getProjects()) {
     TychoProject projectType = projectTypes.get(otherProject.getPackaging());
     if (projectType != null
         && projectType
             .getArtifactKey(DefaultReactorProject.adapt(otherProject))
             .getId()
             .equals(symbolicName)) {
       return otherProject;
     }
   }
   return null;
 }
Пример #2
0
  private void createDevProperties(
      boolean includeReactorProjects, List<ReactorProject> reactorProjects)
      throws MojoExecutionException {
    Properties dev = new Properties();

    if (includeReactorProjects) {
      // this is needed for IDE integration, where we want to use reactor project output folders
      dev.put("@ignoredot@", "true");
      for (ReactorProject otherProject : reactorProjects) {
        if ("eclipse-test-plugin".equals(otherProject.getPackaging())
            || "eclipse-plugin".equals(otherProject.getPackaging())) {
          TychoProject projectType = projectTypes.get(otherProject.getPackaging());
          dev.put(
              projectType.getArtifactKey(otherProject).getId(),
              getBuildOutputDirectories(otherProject));
        }
      }
    }

    ReactorProject reactorProject = DefaultReactorProject.adapt(project);

    TychoProject projectType = projectTypes.get(project.getPackaging());
    dev.put(
        projectType.getArtifactKey(reactorProject).getId(),
        getBuildOutputDirectories(reactorProject));

    try {
      OutputStream os = new BufferedOutputStream(new FileOutputStream(devProperties));
      try {
        dev.store(os, null);
      } finally {
        os.close();
      }
    } catch (IOException e) {
      throw new MojoExecutionException("Can't create osgi dev properties file", e);
    }
  }