diff options
Diffstat (limited to 'maven-plugins/trunk/maven-bundle-plugin/src/main/java')
2 files changed, 17 insertions, 5 deletions
diff --git a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundleUtil.java b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundleUtil.java index 8c36cdaec2..04fa342161 100644 --- a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundleUtil.java +++ b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundleUtil.java @@ -162,7 +162,7 @@ public final class BundleUtil { if (env == null) { env = "JavaSE-1.6"; } - exportedPackages.removeAll(getSystemPackages(env)); + Set<String> sysPackages = getSystemPackages(env); // Generate export-package and import-package declarations StringBuffer exports = new StringBuffer(); @@ -170,7 +170,7 @@ public final class BundleUtil { Set<String> pkgs = new HashSet<String>(); for (String export : exportedPackages) { String packageName = packageName(export); - if (!pkgs.contains(packageName)) { + if (!pkgs.contains(packageName) && !sysPackages.contains(packageName)) { // Add corresponding import declaration if (!"META-INF.services".equals(packageName)) { imports.append(export); @@ -180,7 +180,7 @@ public final class BundleUtil { exports.append(export); exports.append(','); } else { - logger.warning("Duplicate package skipped: " + export); + logger.warning("Duplicate or system package skipped: " + export); } } diff --git a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java index 52821e5214..8435691019 100644 --- a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java +++ b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/ModuleBundlesBuildMojo.java @@ -35,6 +35,7 @@ import java.io.InputStream; import java.io.PrintStream; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -279,6 +280,11 @@ public class ModuleBundlesBuildMojo extends AbstractMojo { * @parameter default-value="tuscany-sca-equinox-manifest.jar" */ private String equinoxManifestJarName = "tuscany-sca-equinox-manifest.jar"; + + /** + * @parameter default-value="jar,bundle" + */ + private String artifactTypes; /** * @parameter default-value="true" @@ -505,9 +511,15 @@ public class ModuleBundlesBuildMojo extends AbstractMojo { continue; } + if (artifactTypes == null) { + artifactTypes = "jar,bundle"; + } + String types[] = artifactTypes.trim().split("( |\t|\n|\r|\f|,)+"); + Set<String> typeSet = new HashSet<String>(Arrays.asList(types)); + // Only consider JAR and WAR files - if (!"jar".equals(artifact.getType()) && !"bundle".equals(artifact.getType()) - && !"war".equals(artifact.getType())) { + if (!typeSet.contains(artifact.getType())) { + log.debug("Artifact with unknown type is skipped: " + artifact); continue; } |