From 827a22b82cfbf835328d9061e67087bcb2110187 Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 30 Sep 2010 16:50:25 +0000 Subject: Ignore provided, test and system scopes when creating meta-data. Also sort the meta data just for readability. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1003153 13f79535-47bb-0310-9956-ffa450edef68 --- .../bundle/plugin/BundlesMetaDataBuildMojo.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'maven-plugins/trunk/maven-bundle-plugin/src/main/java') diff --git a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundlesMetaDataBuildMojo.java b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundlesMetaDataBuildMojo.java index 4a793fc8c1..8d6cfd9aa4 100644 --- a/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundlesMetaDataBuildMojo.java +++ b/maven-plugins/trunk/maven-bundle-plugin/src/main/java/org/apache/tuscany/maven/bundle/plugin/BundlesMetaDataBuildMojo.java @@ -42,6 +42,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeSet; import java.util.jar.Attributes; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; @@ -391,13 +392,20 @@ public class BundlesMetaDataBuildMojo extends AbstractMojo { artifact.getArtifactId().equals(p.getArtifactId())){ a = p.getArtifact(); } - if (a != null) { - Set names = nameMap.get(p.getArtifactId()); - if (names == null) { - names = new HashSet(); - nameMap.put(p.getArtifactId(), names); + if (a != null) { + if (a.getScope() != null && + (a.getScope().equals("provided") || + a.getScope().equals("test") || + a.getScope().equals("system"))){ + // ignore the artifact + } else { + Set names = nameMap.get(p.getArtifactId()); + if (names == null) { + names = new TreeSet(); + nameMap.put(p.getArtifactId(), names); + } + names.add(name); } - names.add(name); } } artifactToNameMap.put(key, name); -- cgit v1.2.3