openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r441318 - in /incubator/openjpa/trunk: openjpa-all/ openjpa-all/pom.xml openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java openjpa-project/README.txt openjpa-project/assembly.xml openjpa-project/pom.xml pom.xml
Date Fri, 08 Sep 2006 01:24:19 GMT
Author: mprudhom
Date: Thu Sep  7 18:24:18 2006
New Revision: 441318

URL: http://svn.apache.org/viewvc?view=rev&rev=441318
Log:
Added openjpa-all module which will manually create an openjpa-all-VERSION.jar file that aggregates
all the other openja-*.jar files; fixed Configurations.java to provide more information when
a missing services resource is caused by a deeper exception

Added:
    incubator/openjpa/trunk/openjpa-all/
    incubator/openjpa/trunk/openjpa-all/pom.xml
Modified:
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
    incubator/openjpa/trunk/openjpa-project/README.txt
    incubator/openjpa/trunk/openjpa-project/assembly.xml
    incubator/openjpa/trunk/openjpa-project/pom.xml
    incubator/openjpa/trunk/pom.xml

Added: incubator/openjpa/trunk/openjpa-all/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-all/pom.xml?view=auto&rev=441318
==============================================================================
--- incubator/openjpa/trunk/openjpa-all/pom.xml (added)
+++ incubator/openjpa/trunk/openjpa-all/pom.xml Thu Sep  7 18:24:18 2006
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+        http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>openjpa-all</artifactId>
+    <packaging>jar</packaging>
+    <name>OpenJPA Aggregate Jar</name>
+    <parent>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa</artifactId>
+        <version>0.9.0-incubating-SNAPSHOT</version>
+    </parent>
+    <build>
+        <plugins>
+            <plugin>
+                <!--
+                    Manually build an aggregate jar of all the other
+                    openjpa-* jars using ant. We cannot use the assembly
+                    plugin, since it doesn't provide support for appending
+                    multiple same-named files to each other (which is
+                    required for correctly aggregating services files).
+                -->
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>build-single-jar</id>
+                        <phase>package</phase>
+                        <configuration>
+                            <tasks>
+                                <unjar overwrite="false"
+                                    dest="${basedir}/target/classes">
+                                    <fileset dir="${basedir}/..">
+                                        <include name="*/target/openjpa-*.jar"/>
+                                    </fileset>
+                                </unjar>
+
+                                <!--
+                                    need to manually concatinate the services 
+                                    resources so they are aggregated
+                                -->
+                                <macrodef name="aggregate-file">
+                                   <attribute name="servicename"/>
+                                    <sequential>
+                                        <echo>Building service: @{servicename}</echo>
+                                        <concat destfile="${basedir}/target/classes/META-INF/services/@{servicename}">
+                                            <fileset dir="${basedir}/.." includes="*/src/main/resources/META-INF/services/@{servicename}"/>
+                                        </concat>
+                                    </sequential>
+                                </macrodef>
+
+                                <aggregate-file servicename="org.apache.openjpa.conf.ProductDerivation"/>
+                                <aggregate-file servicename="javax.persistence.spi.PersistenceProvider"/>
+                                <aggregate-file servicename="org.apache.openjpa.kernel.exps.ExpressionParser"/>
+                                <aggregate-file servicename="org.apache.openjpa.lib.conf.ConfigurationProvider"/>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--
+                create enhancer pre-main attribute
+                copied from openjpa-kernel-5/pom.xml
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestEntries>
+                            <Premain-Class>
+                                org.apache.openjpa.enhance.PCEnhancerAgent</Premain-Class>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-persistence-jdbc</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+    </dependencies>
+</project>

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?view=diff&rev=441318&r1=441317&r2=441318
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
(original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
Thu Sep  7 18:24:18 2006
@@ -18,8 +18,10 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.Properties;
@@ -30,6 +32,7 @@
 
 import org.apache.commons.lang.exception.NestableRuntimeException;
 import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.lib.util.JavaVersions;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.lib.util.ParseException;
@@ -466,36 +469,40 @@
             (ConfigurationProvider.class, loader);
         ConfigurationProvider provider = null;
         int providerCount = 0;
-        StringBuffer errs = null;
+        List errs = null;
         for (int i = 0; i < impls.length; i++) {
-            provider = newProvider(impls[i]);
-            if (provider == null)
-                continue;
-
-            providerCount++;
             try {
+                provider = (ConfigurationProvider) impls[i].newInstance();
+                if (provider == null)
+                    continue;
+
+                providerCount++;
+
                 if ((globals && provider.loadGlobals(loader))
                     || (!globals && provider.loadDefaults(loader)))
                     return provider;
             } catch (MissingResourceException mre) {
                 throw mre;
-            } catch (Exception e) {
-                if (errs == null)
-                    errs = new StringBuffer();
-                else
-                    errs.append(", ");
-                errs.append(e.toString());
+            } catch (Throwable t) {
+                (errs == null ? errs = new ArrayList() : errs).add(t);
             }
         }
 
         String type = (globals) ? "globals" : "defaults";
+        MissingResourceException ex = null;
+
         if (errs != null)
-            throw new MissingResourceException(errs.toString(),
+            ex = new MissingResourceException(errs.toString(),
                 Configurations.class.getName(), type);
-        if (providerCount == 0)
-            throw new MissingResourceException(_loc.get ("no-providers", 
+        else if (providerCount == 0)
+            ex = new MissingResourceException(_loc.get ("no-providers", 
                 ConfigurationProvider.class.getName()).getMessage(),
                 Configurations.class.getName(), type);
+
+        if (ex != null)
+            throw (MissingResourceException) JavaVersions.initCause(ex,
+                errs.size() == 0 ? null : (Throwable) errs.get(0));
+
         return null;
     }
 

Modified: incubator/openjpa/trunk/openjpa-project/README.txt
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-project/README.txt?view=diff&rev=441318&r1=441317&r2=441318
==============================================================================
--- incubator/openjpa/trunk/openjpa-project/README.txt (original)
+++ incubator/openjpa/trunk/openjpa-project/README.txt Thu Sep  7 18:24:18 2006
@@ -1,2 +1,6 @@
 
-Thanks!
+Thank you for downloading this incubator release of OpenJPA. For
+documentation and project information, please see:
+
+  http://incubator.apache.org/openjpa/
+

Modified: incubator/openjpa/trunk/openjpa-project/assembly.xml
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-project/assembly.xml?view=diff&rev=441318&r1=441317&r2=441318
==============================================================================
--- incubator/openjpa/trunk/openjpa-project/assembly.xml (original)
+++ incubator/openjpa/trunk/openjpa-project/assembly.xml Thu Sep  7 18:24:18 2006
@@ -12,6 +12,7 @@
                 <include>NOTICE*</include>
             </includes>
         </fileSet>
+        <!--
         <fileSet>
             <directory>licenses</directory>
             <outputDirectory>/lib</outputDirectory>
@@ -31,6 +32,7 @@
             <directory>target/examples</directory>
             <outputDirectory>/examples</outputDirectory>
         </fileSet>
+        -->
     </fileSets>
     <dependencySets>
         <dependencySet>
@@ -65,30 +67,43 @@
 
                 <!-- optional -->
                 <exclude>junit:junit</exclude>
+
+                <!-- these are placed in the modules/ directory -->
+                <exclude>org.apache.openjpa:openjpa-all</exclude>
+                <exclude>org.apache.openjpa:openjpa-lib</exclude>
+                <exclude>org.apache.openjpa:openjpa-kernel</exclude>
+                <exclude>org.apache.openjpa:openjpa-kernel-4</exclude>
+                <exclude>org.apache.openjpa:openjpa-kernel-5</exclude>
+                <exclude>org.apache.openjpa:openjpa-jdbc</exclude>
+                <exclude>org.apache.openjpa:openjpa-jdbc-5</exclude>
+                <exclude>org.apache.openjpa:openjpa-persistence</exclude>
+                <exclude>org.apache.openjpa:openjpa-persistence-jdbc</exclude>
+                <exclude>org.apache.openjpa:openjpa-xmlstore</exclude>
             </excludes>
         </dependencySet>
 
-
-        <!--
         <dependencySet>
-            <outputDirectory>/optional</outputDirectory>
+            <outputDirectory>/modules</outputDirectory>
             <unpack>false</unpack>
-            <scope>runtime</scope>
             <includes>
-                <include>org.apache.derby:derby</include>
+                <include>org.apache.openjpa:openjpa-lib</include>
+                <include>org.apache.openjpa:openjpa-kernel</include>
+                <include>org.apache.openjpa:openjpa-kernel-4</include>
+                <include>org.apache.openjpa:openjpa-kernel-5</include>
+                <include>org.apache.openjpa:openjpa-jdbc</include>
+                <include>org.apache.openjpa:openjpa-jdbc-5</include>
+                <include>org.apache.openjpa:openjpa-persistence</include>
+                <include>org.apache.openjpa:openjpa-persistence-jdbc</include>
+                <include>org.apache.openjpa:openjpa-xmlstore</include>
             </includes>
         </dependencySet>
-        -->
 
-        <!--
-         <dependencySet>
+        <dependencySet>
             <outputDirectory>/</outputDirectory>
             <unpack>false</unpack>
-            <scope>runtime</scope>
             <includes>
                 <include>org.apache.openjpa:openjpa-all</include>
             </includes>
         </dependencySet>
-        -->
     </dependencySets>
 </assembly>

Modified: incubator/openjpa/trunk/openjpa-project/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-project/pom.xml?view=diff&rev=441318&r1=441317&r2=441318
==============================================================================
--- incubator/openjpa/trunk/openjpa-project/pom.xml (original)
+++ incubator/openjpa/trunk/openjpa-project/pom.xml Thu Sep  7 18:24:18 2006
@@ -12,7 +12,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>openjpa-project</artifactId>
     <packaging>pom</packaging>
-    <name>OpenJPA Project</name>
+    <name>OpenJPA Distribution</name>
     <parent>
         <groupId>org.apache.openjpa</groupId>
         <artifactId>openjpa</artifactId>
@@ -78,7 +78,7 @@
                         <id>bin</id>
                         <phase>package</phase>
                         <goals>
-                            <goal>assembly</goal>
+                            <goal>attached</goal>
                         </goals>
                         <configuration>
                             <descriptor>assembly.xml</descriptor>
@@ -91,7 +91,7 @@
                         <id>sources</id>
                         <phase>package</phase>
                         <goals>
-                            <goal>assembly</goal>
+                            <goal>attached</goal>
                         </goals>
                         <configuration>
                             <descriptor>source-assembly.xml</descriptor>
@@ -134,6 +134,11 @@
 
     <!-- need to explicitly list dependencies for assembly to work -->
     <dependencies>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-all</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa-lib</artifactId>

Modified: incubator/openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/pom.xml?view=diff&rev=441318&r1=441317&r2=441318
==============================================================================
--- incubator/openjpa/trunk/pom.xml (original)
+++ incubator/openjpa/trunk/pom.xml Thu Sep  7 18:24:18 2006
@@ -86,6 +86,7 @@
         <module>openjpa-kernel</module>
         <module>openjpa-jdbc</module>
         <module>openjpa-xmlstore</module>
+        <module>openjpa-all</module>
         <module>openjpa-project</module>
     </modules>
     <profiles>



Mime
View raw message