Theoretically, Eclipse plugins, such as WTP and JBosd, can do this, but today they only work in a complete IDE, and not as a separate command-line tool that can be called using Ant or Maven.
Worse, these tools have never been perfect. They always report tons of false positives, and usually their validation algorithms are usually years ago. The current version of WTP probably barely checks everything starting with Java EE 5 (perhaps it still misses some obscure features).
As a result, if you abandon an assembly based on this check, you probably can never deploy it. Even in the most carefully coded and fully valid web applications, the WTP and JBoss tools find it necessary to report hundreds or thousands of warnings and errors in large projects. IMHO completely useless to depend.
source share