You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/06/07 15:13:30 UTC

svn commit: r412400 - in /incubator/felix/trunk: org.apache.felix.bundlerepository/ org.apache.felix.http.jetty/ org.apache.felix.shell.gui.plugin/ org.apache.felix.shell.gui/ org.apache.felix.shell.tui/ org.apache.felix.shell/ tools/maven2/maven-osgi-...

Author: rickhall
Date: Wed Jun  7 06:13:30 2006
New Revision: 412400

URL: http://svn.apache.org/viewvc?rev=412400&view=rev
Log:
Modified the Maven OSGi plugin to require:
    <bundleActivator>auto-detect</bundleActivator>
To trigger activator detection. If nothing is specified for the bundle
activator tag, then nothing is done. Also modified my existing pom files
accordingly.

Modified:
    incubator/felix/trunk/org.apache.felix.bundlerepository/pom.xml
    incubator/felix/trunk/org.apache.felix.http.jetty/pom.xml
    incubator/felix/trunk/org.apache.felix.shell.gui.plugin/pom.xml
    incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml
    incubator/felix/trunk/org.apache.felix.shell.tui/pom.xml
    incubator/felix/trunk/org.apache.felix.shell/pom.xml
    incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java

Modified: incubator/felix/trunk/org.apache.felix.bundlerepository/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.bundlerepository/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.bundlerepository/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.bundlerepository/pom.xml Wed Jun  7 06:13:30 2006
@@ -37,6 +37,7 @@
         <configuration>
           <osgiManifest>
             <bundleName>BundleRepository</bundleName>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDescription>Bundle repository service.</bundleDescription>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</bundleUrl>

Modified: incubator/felix/trunk/org.apache.felix.http.jetty/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.http.jetty/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.http.jetty/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.http.jetty/pom.xml Wed Jun  7 06:13:30 2006
@@ -43,6 +43,7 @@
           <osgiManifest>
             <bundleName>HTTP Service</bundleName>
             <bundleDescription>An implementation of the OSGi HTTP Service using Jetty.</bundleDescription>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</bundleUrl>
             <bundleSource>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</bundleSource>

Modified: incubator/felix/trunk/org.apache.felix.shell.gui.plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.shell.gui.plugin/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui.plugin/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.shell.gui.plugin/pom.xml Wed Jun  7 06:13:30 2006
@@ -45,6 +45,7 @@
           <osgiManifest>
             <bundleName>ShellGUIPlugin</bundleName>
             <bundleDescription>A simple set of plugins for the ShellGUI bundle.</bundleDescription>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</bundleUrl>
             <bundleSource>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</bundleSource>

Modified: incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml Wed Jun  7 06:13:30 2006
@@ -27,6 +27,7 @@
           <osgiManifest>
             <bundleName>ShellGUI</bundleName>
             <bundleDescription>A simple plugin-oriented GUI shell.</bundleDescription>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/shellgui/${pom.artifactId}-${pom.version}.jar</bundleUrl>
             <bundleSource>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</bundleSource>

Modified: incubator/felix/trunk/org.apache.felix.shell.tui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.shell.tui/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.tui/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.shell.tui/pom.xml Wed Jun  7 06:13:30 2006
@@ -33,6 +33,7 @@
           <osgiManifest>
             <bundleName>ShellTUI</bundleName>
             <bundleDescription>A simple textual user interface for Felix' shell service.</bundleDescription>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</bundleUrl>
             <bundleSource>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</bundleSource>

Modified: incubator/felix/trunk/org.apache.felix.shell/pom.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.shell/pom.xml?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell/pom.xml (original)
+++ incubator/felix/trunk/org.apache.felix.shell/pom.xml Wed Jun  7 06:13:30 2006
@@ -27,6 +27,7 @@
           <osgiManifest>
             <bundleName>ShellService</bundleName>
             <bundleDescription>A simple OSGi command shell service.</bundleDescription>
+            <bundleActivator>auto-detect</bundleActivator>
             <bundleDocUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/</bundleDocUrl>
             <bundleUrl>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</bundleUrl>
             <bundleSource>http://oscar-osgi.sf.net/obr2/${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</bundleSource>

Modified: incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java?rev=412400&r1=412399&r2=412400&view=diff
==============================================================================
--- incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java (original)
+++ incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java Wed Jun  7 06:13:30 2006
@@ -40,6 +40,7 @@
  */
 public class OsgiJarMojo extends AbstractMojo {
     public static final String OSGI_REFERENCES = "osgi.references";
+    public static final String AUTO_DETECT = "auto-detect";
 
 	private static final String[]		EMPTY_STRING_ARRAY		= {};
 
@@ -243,18 +244,20 @@
 
 	private void verifyBundleActivator(Jar mainJar) {
 		String ba = osgiManifest.getBundleActivator();
-		if (ba == null || ba.trim().length() == 0) {
+		if ((ba != null) && ba.equals(AUTO_DETECT)) {
 			switch ( mainJar.activators.size() ) {
-				case 0: break;
-				case 1: archiveConfig.addManifestEntry("Bundle-Activator", mainJar.activators.get(0));
-				break;
+				case 0:
+                    break;
+				case 1:
+                    archiveConfig.addManifestEntry("Bundle-Activator", mainJar.activators.get(0));
+				    break;
 				default:
-					getLog().info("[OSGi] No Bundle-Activator specified and multiple found" );
-				break;
+					getLog().info("[OSGi] Multiple activators found, unable to auto-detect." );
+				    break;
 			}
 		}
-		else {
-			if( ! mainJar.activators.contains(ba))
+		else if (ba != null) {
+			if (!mainJar.activators.contains(ba))
 				getLog().warn("[OSGi] UNABLE TO VERIFY BUNDLE ACTIVATOR: " + ba);
 		}
 	}