From aefd05089d3a1b2a84476e4c9cff838af0d1f8e5 Mon Sep 17 00:00:00 2001
From: Donald Woods <dwoods@apache.org>
Date: Wed, 15 Jul 2009 20:48:08 +0000
Subject: [PATCH] OPENJPA-1170 Fix which validation/jpa2 spec jars and versions
 are pulled in by transitive Maven depends.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@794409 13f79535-47bb-0310-9956-ffa450edef68
---
 openjpa-integration/validation/pom.xml | 28 ++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/openjpa-integration/validation/pom.xml b/openjpa-integration/validation/pom.xml
index db0a96676..9b1c9b1af 100644
--- a/openjpa-integration/validation/pom.xml
+++ b/openjpa-integration/validation/pom.xml
@@ -81,8 +81,13 @@
                     <artifactId>agimatec-jsr303</artifactId>
                     <version>0.9.1-SNAPSHOT</version>
                     <scope>test</scope>
-                    <!-- force usage of the geronimo-validation spec -->
                     <exclusions>
+                        <!-- force usage of the geronimo-validation_1.0_spec -->
+                        <exclusion>
+                            <groupId>javax.validation</groupId>
+                            <artifactId>validation-api</artifactId>
+                        </exclusion>
+                        <!-- use our level of the geronimo-jpa_2.0_spec -->
                         <exclusion>
                             <groupId>javax.validation</groupId>
                             <artifactId>validation-api</artifactId>
@@ -135,21 +140,27 @@
                 <dependency>
                     <groupId>javax.validation</groupId>
                     <artifactId>validation-api</artifactId>
-                    <version>1.0.CR1</version>
-                    <!-- <version>1.0.CR3-SNAPSHOT</version> -->
+                    <version>1.0.CR2</version>
+                    <!-- <version>1.0.CR3</version> -->
                     <scope>test</scope>
                 </dependency>
                 <dependency>
                     <groupId>org.hibernate</groupId>
                     <artifactId>hibernate-validator</artifactId>
-                    <version>4.0.0.Alpha3</version>
+                    <version>4.0.0.Beta1</version>
                     <!-- <version>4.0.0.Beta2-SNAPSHOT</version> -->
                     <scope>test</scope>
                     <exclusions>
+                        <!-- force usage of the geronimo-jpa_2.0_spec -->
                         <exclusion>
                             <groupId>org.hibernate.java-persistence</groupId>
                             <artifactId>jpa-api</artifactId>
                         </exclusion>
+                        <!-- force usage of the RI API level above -->
+                        <exclusion>
+                            <groupId>javax.validation</groupId>
+                            <artifactId>validation-api</artifactId>
+                        </exclusion>
                     </exclusions>
                 </dependency>
                 <dependency>
@@ -178,7 +189,6 @@
                         <enabled>true</enabled>
                     </releases>
                 </repository>
-                <!--
                 <repository>
                     <id>snapshots.jboss.org</id>
                     <name>JBoss Repository</name>
@@ -191,7 +201,6 @@
                         <enabled>false</enabled>
                     </releases>
                 </repository>
-                -->
             </repositories>
         </profile>
     </profiles>
@@ -201,6 +210,13 @@
             <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa</artifactId>
             <version>${pom.version}</version>
+            <!-- allow profiles to decide which validation spec to use -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.geronimo.specs</groupId>
+                    <artifactId>geronimo-validation_1.0_spec</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.openjpa</groupId>