コード例 #1
0
    private void addBundleListDependencies()
        throws IOException, XmlPullParserException, MojoExecutionException {
      BundleList bundleList;

      if (bundleListFile.exists()) {
        bundleList = readBundleList(bundleListFile);
      } else {
        bundleList = new BundleList();
      }

      if (additionalBundles != null) {
        for (ArtifactDefinition def : additionalBundles) {
          bundleList.add(def.toBundleList());
        }
      }

      interpolateProperties(bundleList, project, session);

      for (StartLevel startLevel : bundleList.getStartLevels()) {
        for (Bundle bundle : startLevel.getBundles()) {
          log.debug(
              String.format(
                  "adding bundle (%s) from bundle list to dependencies of project %s",
                  bundle, project));
          project.getDependencies().addAll(ArtifactDefinition.toDependencyList(bundle, PROVIDED));
        }
      }
    }
コード例 #2
0
    void addDependencies() throws Exception {
      readConfiguration();

      addBundleListDependencies();

      if (hasPreparePackageExecution()) {
        if (includeDefaultBundles && !isCurrentArtifact(project, defaultBundleList)) {
          log.debug(
              String.format(
                  "adding default bundle list (%s) to dependencies of project %s",
                  defaultBundleList, project));
          project.getDependencies().addAll(defaultBundleList.toDependencyList(PROVIDED));
        }

        if (hasJarPackagingExecution()) {
          log.debug(
              String.format(
                  "adding jar web support (%s) to dependencies of project %s",
                  jarWebSupport, project));
          project.getDependencies().addAll(jarWebSupport.toDependencyList(PROVIDED));
        }
      }
    }