Author: dwoods
Date: Wed May 20 20:42:47 2009
New Revision: 776844

URL: http://svn.apache.org/viewvc?rev=776844&view=rev
Log:
OPENJPA-1062 adding bundle metadata to openjpa.jar.  verified it will 
install/start in felix using the rough instructions at 
http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/README

Modified:
    openjpa/trunk/openjpa-all/pom.xml
    openjpa/trunk/openjpa/pom.xml
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/openjpa-all/pom.xml
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-all/pom.xml?rev=776844&r1=776843&r2=776844&view=diff
==============================================================================
--- openjpa/trunk/openjpa-all/pom.xml (original)
+++ openjpa/trunk/openjpa-all/pom.xml Wed May 20 20:42:47 2009
@@ -62,12 +62,30 @@
                 </executions>
             </plugin>
 
+            <!--
+                create enhancer pre-main attribute
+            -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
                 <configuration>
                     <archive>
+                        <!-- only if we're using maven-bundle-plugin
                         
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                        -->
+                        <!-- reset openjpa aggregate bundle metadata -->
+                        <manifest>
+                           
<mainClass>org.apache.openjpa.conf.OpenJPAVersion</mainClass>
+                        </manifest>
+                        <manifestEntries>
+                            <Premain-Class>
+                                org.apache.openjpa.enhance.PCEnhancerAgent
+                            </Premain-Class>
+                            <Can-Redefine-Classes>true</Can-Redefine-Classes>
+                            <Specification-Title>JSR-317 Java 
Persistence</Specification-Title>
+                            <Specification-Vendor>Sun Microsystems, 
Inc.</Specification-Vendor>
+                            <Specification-Version>2.0</Specification-Version>
+                        </manifestEntries>
                     </archive>
                 </configuration>
             </plugin>
@@ -81,6 +99,10 @@
                         <goals>
                             <goal>shade</goal>
                         </goals>
+                        <configuration>
+                            
<createDependencyReducedPom>true</createDependencyReducedPom>
+                            
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>

Modified: openjpa/trunk/openjpa/pom.xml
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa/pom.xml?rev=776844&r1=776843&r2=776844&view=diff
==============================================================================
--- openjpa/trunk/openjpa/pom.xml (original)
+++ openjpa/trunk/openjpa/pom.xml Wed May 20 20:42:47 2009
@@ -47,7 +47,7 @@
                 <executions>
                     <execution>
                         <id>build-single-jar</id>
-                        <phase>process-classes</phase>
+                        <phase>compile</phase>
                         <configuration>
                             <tasks>
                                 <unjar overwrite="false" 
dest="${basedir}/target/classes">
@@ -94,6 +94,7 @@
                 <artifactId>maven-jar-plugin</artifactId>
                 <configuration>
                     <archive>
+                        
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                         <manifest>
                            
<mainClass>org.apache.openjpa.conf.OpenJPAVersion</mainClass>
                         </manifest>
@@ -106,6 +107,41 @@
                     </archive>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Name>${artifactId}</Bundle-Name>
+                        
<Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        
<Bundle-DocURL>http://openjpa.apache.org/documentation.html</Bundle-DocURL>
+                        <Implementation-Title>Apache 
OpenJPA</Implementation-Title>
+                        
<Implementation-Version>${project.version}</Implementation-Version>
+                        <Specification-Title>JSR-317 Java 
Persistence</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, 
Inc.</Specification-Vendor>
+                        <Specification-Version>2.0</Specification-Version>
+                        <!-- OSGi Bundle Metadata -->
+                        
<Private-Package>org.openjpa.lib.ant*,org.apache.jdbc.ant*,META-INF*</Private-Package>
+                        
<Export-Package>!META-INF*,!org.openjpa.lib.ant*,!org.apache.jdbc.ant*,org.apache.openjpa*</Export-Package>
+                        
<Import-Package>com.ibm.*;resolution:=optional,org.postgresql.*;resolution:=optional,org.apache.tools.ant.*;resolution:=optional,org.apache.log4j.*;resolution:=optional,javax.activation.*;resolution:=optional,javax.xml.bind.*;resolution:=optional,serp.*;resolution:=optional,*</Import-Package>
+                        <!-- Eclipse metadata -->
+                        <Eclipse-Autostart>false</Eclipse-Autostart>
+                        <Bundle-ClassPath>.</Bundle-ClassPath>
+                    </instructions>
+                    <unpackBundle>true</unpackBundle>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <dependencies>
@@ -146,6 +182,12 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-slice</artifactId>
+            <version>${pom.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>net.sourceforge.serp</groupId>
             <artifactId>serp</artifactId>
         </dependency>

Modified: openjpa/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=776844&r1=776843&r2=776844&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Wed May 20 20:42:47 2009
@@ -660,6 +660,11 @@
                     <artifactId>maven-checkstyle-plugin</artifactId>
                     <version>2.2</version>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>maven-bundle-plugin</artifactId>
+                    <version>1.4.3</version>
+                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>


Reply via email to