You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by dw...@apache.org on 2010/05/21 20:14:27 UTC

svn commit: r947109 - in /incubator/bval/trunk: apache-bval/ apache-bval/pom.xml bval-core/pom.xml bval-guice/pom.xml bval-jsr303/pom.xml bval-tck/pom.xml pom.xml

Author: dwoods
Date: Fri May 21 18:14:26 2010
New Revision: 947109

URL: http://svn.apache.org/viewvc?rev=947109&view=rev
Log:
BVAL-57 Create a single apache-bval jar/bundle.  OSGi users should now pickup the apache-bval jarfile.  Also updated modules to use the new apache-bval instead of separate depends on bval-core and bval-jsr303. Update bval-tck to use the geronimo-validation_1.0_spec for runtime to match build time.

Added:
    incubator/bval/trunk/apache-bval/
    incubator/bval/trunk/apache-bval/pom.xml   (with props)
Modified:
    incubator/bval/trunk/bval-core/pom.xml
    incubator/bval/trunk/bval-guice/pom.xml
    incubator/bval/trunk/bval-jsr303/pom.xml
    incubator/bval/trunk/bval-tck/pom.xml
    incubator/bval/trunk/pom.xml

Added: incubator/bval/trunk/apache-bval/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/apache-bval/pom.xml?rev=947109&view=auto
==============================================================================
--- incubator/bval/trunk/apache-bval/pom.xml (added)
+++ incubator/bval/trunk/apache-bval/pom.xml Fri May 21 18:14:26 2010
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!--
+	Maven release plugin requires the project tag to be on a single line.
+-->
+<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>
+
+    <parent>
+        <groupId>org.apache.bval</groupId>
+        <artifactId>bval-parent</artifactId>
+        <version>0.1-incubating-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>apache-bval</artifactId>
+    <name>Apache Bean Validation :: apache-bval (bundle)</name>
+    <packaging>bundle</packaging>
+
+    <description>Apache Bean Validation - Aggregate OSGi Bundle (bval-core + bval-jsr303)</description>
+
+    <dependencies>
+        <!-- JARs to include in aggregate JAR via maven-shade-plugin -->
+        <dependency>
+            <groupId>org.apache.bval</groupId>
+            <artifactId>bval-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.bval</groupId>
+            <artifactId>bval-jsr303</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <defaultGoal>install</defaultGoal>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <!--
+                 Need to disable source plugin here, as it overwrites the shade
+                 plugin created sources jar.
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- Create our aggregate JAR -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <createDependencyReducedPom>true</createDependencyReducedPom>
+                            <createSourcesJar>true</createSourcesJar>
+                            <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
+                            <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                            <!--
+                                 Specify a subset of depends to include,
+                                 which must match the <dependencies> section.
+                            -->
+                            <artifactSet>
+                                <includes>
+                                    <include>org.apache.bval:bval-core</include>
+                                    <include>org.apache.bval:bval-jsr303</include>
+                                </includes>
+                            </artifactSet>
+                            <!-- BVAL unique META-INF setup -->
+                            <transformers>
+                                <!--
+                                    Need to concatinate the services resources
+                                -->
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
+                                <!-- Need to add some MANIFEST.MF metadata -->
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Main-Class>org.apache.bval.util.BeanValidationVersion</Main-Class>
+                                        <Implementation-Title>Apache Bean Validation Aggregate JAR</Implementation-Title>
+                                        <Specification-Title>JSR-303 Bean Validation</Specification-Title>
+                                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                                        <Specification-Version>1.0</Specification-Version>
+                                    </manifestEntries>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- extract the shaded jar so a bundle can be created -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <unzip src="${project.build.directory}/${pom.artifactId}-${pom.version}.jar" dest="${project.build.directory}/classes" />
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- create an OSGi bundle -->
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <!-- OSGi Bundle Metadata -->
+                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                        <!-- <Bundle-Activator>org.apache.bval.osgi.BundleActivator</Bundle-Activator> -->
+                        <Private-Package />
+                        <Export-Package>org.apache.bval.*;version=${project.version}</Export-Package>
+                        <Import-Package>*</Import-Package>
+                        <!-- Eclipse metadata -->
+                        <Eclipse-Autostart>false</Eclipse-Autostart>
+                        <Bundle-ClassPath>.</Bundle-ClassPath>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+

Propchange: incubator/bval/trunk/apache-bval/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/bval/trunk/bval-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/pom.xml?rev=947109&r1=947108&r2=947109&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/pom.xml (original)
+++ incubator/bval/trunk/bval-core/pom.xml Fri May 21 18:14:26 2010
@@ -32,7 +32,7 @@
 
     <artifactId>bval-core</artifactId>
     <name>Apache Bean Validation :: bval-core</name>
-    <packaging>bundle</packaging>
+    <packaging>jar</packaging>
 
     <description>Bean Validation Metadata Engine</description>
 

Modified: incubator/bval/trunk/bval-guice/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-guice/pom.xml?rev=947109&r1=947108&r2=947109&view=diff
==============================================================================
--- incubator/bval/trunk/bval-guice/pom.xml (original)
+++ incubator/bval/trunk/bval-guice/pom.xml Fri May 21 18:14:26 2010
@@ -39,7 +39,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.bval</groupId>
-            <artifactId>bval-jsr303</artifactId>
+            <artifactId>apache-bval</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

Modified: incubator/bval/trunk/bval-jsr303/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/pom.xml?rev=947109&r1=947108&r2=947109&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/pom.xml (original)
+++ incubator/bval/trunk/bval-jsr303/pom.xml Fri May 21 18:14:26 2010
@@ -32,7 +32,7 @@
 
     <artifactId>bval-jsr303</artifactId>
     <name>Apache Bean Validation :: bval-jsr303</name>
-    <packaging>bundle</packaging>
+    <packaging>jar</packaging>
 
     <description>Implementation specific classes for JSR 303 Bean Validation 1.0</description>
 
@@ -208,32 +208,6 @@
                 </configuration>
             </plugin>
 
-            <!-- create an OSGi bundle -->
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Specification-Title>JSR-303 Bean Validation</Specification-Title>
-                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
-                        <Specification-Version>1.0</Specification-Version>
-                        <!-- OSGi Bundle Metadata -->
-                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
-                        <Bundle-Activator></Bundle-Activator>
-                        <Private-Package />
-                        <Export-Package>org.apache.bval.*</Export-Package>
-                        <!-- No export version for now...
-                        <Export-Package>org.apache.bval.*;version=${project.version}</Export-Package>
-                        -->
-                        <Import-Package>com.thoughtworks.xstream.*;resolution:=optional,freemarker.template.*;resolution:=optional,javax.persistence.*;resolution:=optional,*</Import-Package>
-                        <!-- Eclipse metadata -->
-                        <Eclipse-Autostart>false</Eclipse-Autostart>
-                        <Bundle-ClassPath>.</Bundle-ClassPath>
-                    </instructions>
-                </configuration>
-            </plugin>
-
         </plugins>
     </build>
 </project>

Modified: incubator/bval/trunk/bval-tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-tck/pom.xml?rev=947109&r1=947108&r2=947109&view=diff
==============================================================================
--- incubator/bval/trunk/bval-tck/pom.xml (original)
+++ incubator/bval/trunk/bval-tck/pom.xml Fri May 21 18:14:26 2010
@@ -34,12 +34,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.bval</groupId>
-            <artifactId>bval-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.bval</groupId>
-            <artifactId>bval-jsr303</artifactId>
+            <artifactId>apache-bval</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
@@ -72,10 +67,16 @@
                 </property>
             </activation>
             <dependencies>
+                <!-- Use the geronimo-validation spec instead
                 <dependency>
                     <groupId>javax.validation</groupId>
                     <artifactId>validation-api</artifactId>
                 </dependency>
+                -->
+                <dependency>
+                    <groupId>org.apache.geronimo.specs</groupId>
+                    <artifactId>geronimo-validation_1.0_spec</artifactId>
+                </dependency>
                 <dependency>
                     <groupId>org.slf4j</groupId>
                     <artifactId>slf4j-log4j12</artifactId>
@@ -133,22 +134,23 @@
                                             <classifier>suite</classifier>
                                             <overWrite>false</overWrite>
                                         </artifactItem>
+                                        <!-- use geronimo-validation spec
                                         <artifactItem>
                                             <groupId>javax.validation</groupId>
                                             <artifactId>validation-api</artifactId>
                                             <overWrite>true</overWrite>
                                             <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
                                         </artifactItem>
+                                        -->
                                         <artifactItem>
-                                            <groupId>org.apache.bval</groupId>
-                                            <artifactId>bval-jsr303</artifactId>
-                                            <version>${project.version}</version>
+                                            <groupId>org.apache.geronimo.specs</groupId>
+                                            <artifactId>geronimo-validation_1.0_spec</artifactId>
                                             <overWrite>true</overWrite>
                                             <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
                                         </artifactItem>
                                         <artifactItem>
                                             <groupId>org.apache.bval</groupId>
-                                            <artifactId>bval-core</artifactId>
+                                            <artifactId>apache-bval</artifactId>
                                             <version>${project.version}</version>
                                             <overWrite>true</overWrite>
                                             <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>

Modified: incubator/bval/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/pom.xml?rev=947109&r1=947108&r2=947109&view=diff
==============================================================================
--- incubator/bval/trunk/pom.xml (original)
+++ incubator/bval/trunk/pom.xml Fri May 21 18:14:26 2010
@@ -556,6 +556,7 @@
     <modules>
         <module>bval-core</module>
         <module>bval-jsr303</module>
+        <module>apache-bval</module>
         <module>bval-json</module>
         <module>bval-guice</module>
         <module>bval-tck</module>