jakartaee / validation-spec

Jakarta Validation spec document
http://beanvalidation.org
Apache License 2.0
20 stars 22 forks source link

Adding lib jars to the web archive in TCK may result in an error if the path to the jar has escapable symbols #284

Open marko-bekhta opened 3 months ago

marko-bekhta commented 3 months ago

When the Validation TCK base test adds a few lib dependencies to the web archive, if the dependency path contains escapable symbols, e.g. @, the TCK will fail to find an actual jar, resulting in an entire TCK failing.

CodeSource#getLocation(), which is used to obtain the path to the added lib returns an URL that keeps the escaped symbols in the path.

The suggestion is to resolve the path by converting the URL to URI.

In particular, this can happen on CI where the jars are located in a directory with paths similar to /var/lib/jenkins/workspace/hibernate-validator_smth@tmp

See also https://github.com/jakartaee/validation-tck/pull/198#issue-2253139094 for the patch.