You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bval.apache.org by Brian Stempin <br...@gmail.com> on 2013/06/21 16:54:56 UTC

Question about BVal and Maven

Hi, list!

First and foremost: thanks for the awesome software.

My questions are regarding inclusion of BVal in my project as a Maven
dependency. =A0The instructions are a little bit unclear. I've included the
bundle into my project, but it's not exactly clear what other dependencies
I'm supposed to include. I see the line about needing
org.apache.geronimo.specs geronimo-validation_1.0_spec 1.1, but that's for
BVal 0.4. What do I need to include for BVal 0.5?

My second question is: why do I need to include anything else manually? How
come the APIs implemented by BVal don't come along as a dependency of BVal?

Thanks for your help,
Brian

Re: Question about BVal and Maven

Posted by Matt Benson <gu...@gmail.com>.
With regard to the site documentation, I will certainly take your requests
under advisement.  In the near term, however, I wanted to warn you--JSR 349
is Bean Validation 1.1.  Apache BVal has not yet finished (or really,
begun) implementing v1.1 of the specification.  BVal 0.5 implements JSR
303, Bean Validation 1.0.  So I would expect problems to arise from mixing
the JSR 349 API jar with any release of Apache BVal < 1.1.0 (presumably the
version # we'll adopt when we make a Bean Validation 1.1-compatible BVal
release).

Matt

Re: Question about BVal and Maven

Posted by Brian Stempin <br...@gmail.com>.
Hi Matt,
That update really helps -- thanks!

I didn't realize that there were so many APIs that could be plugged in.  In
my case, I ended up just using JSR 349.  Is there any way that a list of
the more common/popular APIs can be listed in that instruction page?  It
would also be nice if it said why I'd use a certain API over the other.
 For instance, I'm not sure why I'd want to use the suggested geronimo
package over JSR349 (or any other API for that matter).

Thanks for being awesome,
Brian


On Fri, Jun 21, 2013 at 11:42 AM, Matt Benson <gu...@gmail.com> wrote:

> Hi Brian,
>   I have just updated the instructions and formatting on that page of the
> site.  Thanks for bringing it to our attention.
>
> The reason we declare the bean validation specification jars as "provided"
> dependencies (such that they are not pulled transitively by Maven) is that
> there are multiple jars available containing the API classes.  For some
> JSRs (e.g. JSF) it is necessary to couple the API and implementation but in
> the case of Bean Validation it  is possible for a given implementation to
> function with any of multiple possible API jars (unified EL is another
> example of a specification for which an implementation can, for the most
> part, be API-provider-agnostic).  Also, in the case of Bean Validation, it
> is completely kosher to have more than one *implementation* of the
> specification available on the classpath--the API provides mechanisms to
> select the implementation you want to use (and different active parts of
> your codebase might even be using different implementations) but even in
> this case you still, as usual, only want a single copy of the API classes
> available on the classpath.  You might even be adding the Apache BVal
> implementation to a container (e.g. JBoss, Glassfish) that already contains
> the API published by the spec lead (Hibernate Validator) as well as their
> reference implementation.  By the same token, however, you might someday
> find yourself in the opposite situation:  adding Hibernate Validator to an
> Apache TomEE instance (which would use the APIs provided by Geronimo and
> ship BVal as the default Bean Validation implementation).  Our aim is to be
> flexible for you.  I hope this helps to clear things up.
>
> br,
> Matt
>
>
> On Fri, Jun 21, 2013 at 9:54 AM, Brian Stempin <br...@gmail.com>wrote:
>
>> Hi, list!
>>
>> First and foremost: thanks for the awesome software.
>>
>> My questions are regarding inclusion of BVal in my project as a Maven
>> dependency. =A0The instructions are a little bit unclear. I've included the
>> bundle into my project, but it's not exactly clear what other dependencies
>> I'm supposed to include. I see the line about needing
>> org.apache.geronimo.specs geronimo-validation_1.0_spec 1.1, but that's for
>> BVal 0.4. What do I need to include for BVal 0.5?
>>
>> My second question is: why do I need to include anything else manually?
>> How come the APIs implemented by BVal don't come along as a dependency of
>> BVal?
>>
>> Thanks for your help,
>> Brian
>>
>
>

Re: Question about BVal and Maven

Posted by Matt Benson <gu...@gmail.com>.
Hi Brian,
  I have just updated the instructions and formatting on that page of the
site.  Thanks for bringing it to our attention.

The reason we declare the bean validation specification jars as "provided"
dependencies (such that they are not pulled transitively by Maven) is that
there are multiple jars available containing the API classes.  For some
JSRs (e.g. JSF) it is necessary to couple the API and implementation but in
the case of Bean Validation it  is possible for a given implementation to
function with any of multiple possible API jars (unified EL is another
example of a specification for which an implementation can, for the most
part, be API-provider-agnostic).  Also, in the case of Bean Validation, it
is completely kosher to have more than one *implementation* of the
specification available on the classpath--the API provides mechanisms to
select the implementation you want to use (and different active parts of
your codebase might even be using different implementations) but even in
this case you still, as usual, only want a single copy of the API classes
available on the classpath.  You might even be adding the Apache BVal
implementation to a container (e.g. JBoss, Glassfish) that already contains
the API published by the spec lead (Hibernate Validator) as well as their
reference implementation.  By the same token, however, you might someday
find yourself in the opposite situation:  adding Hibernate Validator to an
Apache TomEE instance (which would use the APIs provided by Geronimo and
ship BVal as the default Bean Validation implementation).  Our aim is to be
flexible for you.  I hope this helps to clear things up.

br,
Matt


On Fri, Jun 21, 2013 at 9:54 AM, Brian Stempin <br...@gmail.com>wrote:

> Hi, list!
>
> First and foremost: thanks for the awesome software.
>
> My questions are regarding inclusion of BVal in my project as a Maven
> dependency. =A0The instructions are a little bit unclear. I've included the
> bundle into my project, but it's not exactly clear what other dependencies
> I'm supposed to include. I see the line about needing
> org.apache.geronimo.specs geronimo-validation_1.0_spec 1.1, but that's for
> BVal 0.4. What do I need to include for BVal 0.5?
>
> My second question is: why do I need to include anything else manually?
> How come the APIs implemented by BVal don't come along as a dependency of
> BVal?
>
> Thanks for your help,
> Brian
>