Author: kenney
Date: Fri Jun 22 16:54:45 2007
New Revision: 549982

URL: http://svn.apache.org/viewvc?view=rev&rev=549982
Log:
Move osgi bundle manifest generation to osgi profile.

The generated manifests are incorrect, for instance, maven-project's manifest
misses the package-import org.apache.maven.artifact.transform which should come 
from 
maven-artifact CacheAware*.java.

Further, this doesn't work in an osgi environment, since if each artifact
is a bundle, then maven-embedder must have access to all component.xml files
in all maven core artifacts, and in all dependencies (which aren't bundles
but that can be fixed).
Osgi import/exports for packages work for resources too, but META-INF/ isn't
a package so this doesn't work. This may work with 'Require-Bundle'
(it does in my implementation although i don't think i follow the spec entirely 
;)).
The next problem you get is classcasts for wagon (httplightweightwagon). This
has to be included in a bundle too and get proper exports. The same goes
for all other dependencies (plexus-*).
Maven and plexus are not suited for osgi yet - too much changing is required
in both the metadata structure, the code, and all dependencies and/or
packaging and binary inclusion of dependencies to make this work.
The best bet is to use the one-artifact embedder.


Modified:
    maven/components/trunk/pom.xml

Modified: maven/components/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/pom.xml?view=diff&rev=549982&r1=549981&r2=549982
==============================================================================
--- maven/components/trunk/pom.xml (original)
+++ maven/components/trunk/pom.xml Fri Jun 22 16:54:45 2007
@@ -103,30 +103,6 @@
       </plugins>
     </pluginManagement>
     <plugins>
-      <!-- if plugin not released at maven release time the manifests 
generated could be checked in by hand -->
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>0.9.0-incubator-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>manifest</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <!-- Needed for including the manifest, see MJAR-71 -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.1</version>
-        <configuration>
-          <archive>
-            
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-          </archive>
-        </configuration>
-      </plugin>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.3</version>
@@ -258,6 +234,39 @@
   </pluginRepositories>
 
   <profiles>
+    <profile>
+      <id>osgi</id>
+      <build>
+        <pluginManagement>
+          <plugins>
+            <!-- if plugin not released at maven release time the manifests 
generated could be checked in by hand -->
+            <plugin>
+              <groupId>org.apache.felix</groupId>
+              <artifactId>maven-bundle-plugin</artifactId>
+              <version>0.9.0-incubator-SNAPSHOT</version>
+              <executions>
+                <execution>
+                  <goals>
+                    <goal>manifest</goal>
+                  </goals>
+                </execution>
+              </executions>
+            </plugin>
+            <!-- Needed for including the manifest, see MJAR-71 -->
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-jar-plugin</artifactId>
+              <version>2.1</version>
+              <configuration>
+                <archive>
+                  
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                </archive>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
+    </profile>
     <profile>
       <id>release</id>
       <build>


Reply via email to