| So the issue is this: by adding the java.xml.ws module you impliclitly also add java.xml.ws.annotation. This module contains a subset of the JSR 250 annotations (in the javax.annotation package), but unfortunately not all of them. This causes Weld to not enable our validation interceptor, as the javax.annotation.Priority annotation isn't present. Without that annotation the interceptor won't be registered and no method validation will be performed. You have two options at this point:
- Don't enable - directly or indirectly - the java.xml.ws.annotation module; instead just enable java.xml.bind; The JSR 250 API will be picked up from the unnamed module then (i.e. the classpath), via jboss-annotations-api_1.2_spec-1.0.0.Final.jar, specifically
- Alternatively, enable the java.xml.ws.annotation module but patch it with the full JSR 250 API contents via the --patch-module option
Using that second approach, I could make your test project build successfully like so:
mvn test -DargLine="--add-modules java.xml.ws --patch-module java.xml.ws.annotation=/path/to/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.2_spec/1.0.0.Final/jboss-annotations-api_1.2_spec-1.0.0.Final.jar"
The first approach is easier and the one I'd recommend it. |