incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r943591 - in /incubator/bval/trunk: bval-core/pom.xml bval-jsr303/pom.xml bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java pom.xml
Date Wed, 12 May 2010 17:31:28 GMT
Author: dwoods
Date: Wed May 12 17:31:28 2010
New Revision: 943591

URL: http://svn.apache.org/viewvc?rev=943591&view=rev
Log:
BVAL-41 Package bval artifacts as bundles.  Contributed by David Jencks.

Modified:
    incubator/bval/trunk/bval-core/pom.xml
    incubator/bval/trunk/bval-jsr303/pom.xml
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
    incubator/bval/trunk/pom.xml

Modified: incubator/bval/trunk/bval-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/pom.xml?rev=943591&r1=943590&r2=943591&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/pom.xml (original)
+++ incubator/bval/trunk/bval-core/pom.xml Wed May 12 17:31:28 2010
@@ -31,14 +31,10 @@
     </parent>
 
     <artifactId>bval-core</artifactId>
-    <name>bval-core :: Validation and Metadata Engine</name>
-    <packaging>jar</packaging>
+    <name>Apache Bean Validation :: bval-core</name>
+    <packaging>bundle</packaging>
 
-    <description>
-    This is the implementation of the core validation framework
-    like XML-based extensible metadata, code generation (JSON for AJAX applications),
-    validation of java-beans with relationships.
-    </description>
+    <description>Bean Validation Metadata Engine</description>
 
     <dependencies>
         <dependency>
@@ -66,7 +62,6 @@
         <dependency>
             <groupId>com.thoughtworks.xstream</groupId>
             <artifactId>xstream</artifactId>
-            <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>commons-collections</groupId>
@@ -149,6 +144,30 @@ project.version=${project.version}
                     </archive>
                 </configuration>
             </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></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>freemarker.template.*;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-jsr303/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/pom.xml?rev=943591&r1=943590&r2=943591&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/pom.xml (original)
+++ incubator/bval/trunk/bval-jsr303/pom.xml Wed May 12 17:31:28 2010
@@ -31,16 +31,10 @@
     </parent>
 
     <artifactId>bval-jsr303</artifactId>
-    <name>bval-jsr303 :: Bean Validation 1.0 Implementation</name>
-    <packaging>jar</packaging>
+    <name>Apache Bean Validation :: bval-jsr303</name>
+    <packaging>bundle</packaging>
 
-    <description>
-    This is an implementation of JSR 303 (Bean Validation), a specification
-    of the Java API for Javabean validation in Java EE and Java SE.
-    The technical objective is to provide a class level constraint declaration
-    and validation facility for the Java application developer, as well as a
-    constraint metadata repository and query API.
-    </description>
+    <description>Implementation specific classes for JSR 303 Bean Validation 1.0</description>
 
     <reporting>
         <plugins>
@@ -136,6 +130,10 @@
             <version>${pom.version}</version>
         </dependency>
         <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
@@ -148,11 +146,6 @@
 
         <!-- optional dependencies -->
         <dependency>
-            <groupId>com.thoughtworks.xstream</groupId>
-            <artifactId>xstream</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jpa_2.0_spec</artifactId>
             <!-- allow users to choose an API provider -->
@@ -211,10 +204,37 @@
                 </executions>
                 <configuration>
                     <packageName>org.apache.bval.jsr303.xml</packageName>
-                    <outputDirectory>${basedir}/target/generated-sources</outputDirectory>
                     <extension>true</extension>
                 </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-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java?rev=943591&r1=943590&r2=943591&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
Wed May 12 17:31:28 2010
@@ -20,7 +20,7 @@ package org.apache.bval.jsr303.util;
 
 import org.apache.commons.beanutils.Converter;
 
-import com.thoughtworks.xstream.converters.ConversionException;
+//import com.thoughtworks.xstream.converters.ConversionException;
 
 /**
  * A {@code org.apache.commons.beanutils.Converter} implementation to handle
@@ -57,15 +57,15 @@ public final class EnumerationConverter 
     @SuppressWarnings("unchecked")
     public Object convert(Class type, Object value) {
         if (!type.isEnum()) {
-            throw new ConversionException("Only enum types supported in this version!");
+            throw new RuntimeException("Only enum types supported in this version!");
         }
 
         if (value == null) {
-            throw new ConversionException("Null values not supported in this version!");
+            throw new RuntimeException("Null values not supported in this version!");
         }
 
         if (String.class != value.getClass()) {
-            throw new ConversionException("Only java.lang.String values supported in this
version!");
+            throw new RuntimeException("Only java.lang.String values supported in this version!");
         }
 
         String stringValue = (String) value;

Modified: incubator/bval/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/pom.xml?rev=943591&r1=943590&r2=943591&view=diff
==============================================================================
--- incubator/bval/trunk/pom.xml (original)
+++ incubator/bval/trunk/pom.xml Wed May 12 17:31:28 2010
@@ -51,7 +51,7 @@
 
     <inceptionYear>2010</inceptionYear>
 
-    <url>http://incubator.apache.org/beanvalidation/</url>
+    <url>http://incubator.apache.org/bval/</url>
 
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/bval/trunk</connection>
@@ -93,6 +93,10 @@
         </mailingList>
     </mailingLists>
 
+    <issueManagement>
+        <url>https://issues.apache.org/jira/browse/BVAL</url>
+    </issueManagement>
+    
     <developers>
         <developer>
             <id>romanstumm</id>
@@ -352,6 +356,19 @@
                     <version>1.1</version>
                 </plugin>
                 <plugin>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>maven-bundle-plugin</artifactId>
+                    <version>2.0.1</version>
+                    <extensions>true</extensions>
+                    <configuration>
+                        <instructions>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                        </instructions>
+                    </configuration>
+                </plugin>
+                <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>ianal-maven-plugin</artifactId>
                     <version>1.0-alpha-1</version>
@@ -467,6 +484,10 @@
                 </executions>
             </plugin>
             <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+            </plugin>
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>ianal-maven-plugin</artifactId>
                 <executions>



Mime
View raw message