Maven tomcat: launching target and component-based jsf / converter / validator validation

I am developing a JSF 2.0 application (Mojarra + Primefaces) and am using the maven build environment. Before I used the faces-config.xml file to register my custom converters and validators, everything went well. Then I saw JSF 2.0 syntactic sugar - an annotation based approach. And now I would like to use it instead of the xml configuration file. The problem was that Mojarra was not looking at my annotated classes. I realized that I need to set the attribute <faces-config ... metadata-complete="false">to false. Now it works, but only if I run my application with mvn tomcat:run-war, rather than with mvn tomcat:run, which is more convenient for development. The JSP 2.0 specification says:

If the element in the WEB-INF / faces-config.xml file contains the metaata complete attribute, whose value is "true", the implementation should not annotate scanning for any classes, except for those classes that are provided by the implementation itself. Otherwise, continue as follows.

If the runtime detects a conflict between the entry in the application configuration resources and the annotation, the entry in the application configuration resources takes precedence. All classes in WEB-INF / classes must be scanned.

For each jar in the WEB-INF / lib directory of the application, if the jar contains "META-INF / faces-config.xml", a file or a file that matches the regular expression ". *. Faces-config.xml" (even empty) , all classes in this jar should be scanned.

, maven:)! - ?

,

+5
1

, , : inplace . ..

mvn clean war:inplace tomcat:run

"tomcat: run", .

+1

All Articles