I'm deploying on glassfish and websphere (7 and 8). Making hibernate validator scope provided would solve the problem nicely provided that that implementations is being used by the application server I'm running on.
Not sure about Websphere, but Glassfish is for sure using Hibernate Validator. There you would not need to include any validator jar files into your app.
Can you confirm that if hibernate validator is included in the war it will be automatically registered as provider?
This is not automatically. You specify the default provider in validation.xml which you would add to your app.
I just don't feel right about being forced to register hibernate validator as a provider because we are using those constraints.
Playing devils advocate here - you are using custom Hibernate Validator constraints, so it does not seem to be too far fetched to use Hibernate Validator as provider. As Gunnar is saying, not all constraint implementations are simple standalone classes. There are dependencies to other internal classes as well. I am not saying that I am completely against a separate module, just not 100% convinced yet 
For me the point of the validation api is to have portable implementations of constraints regardless of the provider.
For sure for the standardized constraints, but with custom constraints there is even a possibility that they cannot be portable due to functionality only a given provider has.
|