You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2010/05/05 20:56:03 UTC
svn commit: r941426 -
/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
Author: gawor
Date: Wed May 5 18:56:03 2010
New Revision: 941426
URL: http://svn.apache.org/viewvc?rev=941426&view=rev
Log:
display attributes and directives in display-manifest goal
Modified:
geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
Modified: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java?rev=941426&r1=941425&r2=941426&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java (original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java Wed May 5 18:56:03 2010
@@ -23,6 +23,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import org.apache.geronimo.mavenplugins.osgi.utils.BundleResolver;
import org.apache.maven.plugin.Mojo;
@@ -104,7 +105,28 @@ public class DisplayManifestMojo extends
if (exportPackages != null && exportPackages.length > 0) {
System.out.println("Exports:");
for (ExportPackageDescription exportPackage : exportPackages) {
- System.out.println(TAB + exportPackage);
+ StringBuffer buf = new StringBuffer();
+ buf.append(TAB + exportPackage);
+
+ Map attributes = exportPackage.getAttributes();
+ if (attributes != null) {
+ attributes.remove("version");
+ if (!attributes.isEmpty()) {
+ buf.append(" Attributes: ").append(attributes);
+ }
+ }
+ Map directives = exportPackage.getDirectives();
+ if (directives != null) {
+ directives.remove("uses");
+ directives.remove("x-equinox-ee");
+ directives.remove("x-internal");
+ if (!directives.isEmpty()) {
+ buf.append(" Directives: ").append(directives);
+ }
+ }
+
+ System.out.println(buf);
+
String [] list = (String[])exportPackage.getDirective("uses");
if (list != null) {
System.out.println(TAB + TAB + "Uses: " + Arrays.asList(list));
@@ -119,7 +141,25 @@ public class DisplayManifestMojo extends
if (!imports.isEmpty()) {
System.out.println(header);
for (ImportPackageSpecification importPackage : imports) {
- System.out.println(TAB + importPackage);
+ StringBuffer buf = new StringBuffer();
+ buf.append(TAB + importPackage);
+
+ Map attributes = importPackage.getAttributes();
+ if (attributes != null) {
+ attributes.remove("version");
+ if (!attributes.isEmpty()) {
+ buf.append(" Attributes: ").append(attributes);
+ }
+ }
+ Map directives = importPackage.getDirectives();
+ if (directives != null) {
+ directives.remove("resolution");
+ if (!directives.isEmpty()) {
+ buf.append(" Directives: ").append(directives);
+ }
+ }
+
+ System.out.println(buf);
}
System.out.println();
}