Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven tomcat:run goal and jsf annotation based component/converter/validator scanning
    text
    copied!<p>I'm developing a JSF 2.0 application (Mojarra+Primefaces) and using the maven build environment. Before I have used the faces-config.xml file for registering of my custom converters and validators, everything went well so far. Then I saw some syntactic sugar of JSF 2.0 - the annotation based configuration approach. And now I would like to use it, instead of the xml config file. A problem was that Mojarra didn't scan my annotated classes. I figured out that I needed to put the <code>&lt;faces-config ... metadata-complete="false"&gt;</code> attribute to false. Now it works but only if I start my application with <a href="http://mojo.codehaus.org/tomcat-maven-plugin/plugin-info.html" rel="noreferrer"><code>mvn tomcat:run-war</code></a> goal and not with the <a href="http://mojo.codehaus.org/tomcat-maven-plugin/plugin-info.html" rel="noreferrer"><code>mvn tomcat:run</code></a> dynamic project, which is more comfortable for development. The specification of JSP 2.0 says that:</p> <blockquote> <p>If the element in the WEB-INF/faces-config.xml file contains metadata-complete attribute whose value is "true", the implementation must not perform annotation scanning on any classes except for those classes provided by the implementation itself. Otherwise, continue as follows.</p> <p>If the runtime discovers a conflict between an entry in the Application Configuration Resources and an annotation, the entry in the Application Configuration Resources takes precedence. All classes in WEB-INF/classes must be scanned.</p> <p>For every jar in the application's WEB-INF/lib directory, if the jar contains a "META-INF/faces-config.xml" file or a file that matches the regular expression ".*.faces-config.xml" (even an empty one), all classes in that jar must be scanned.</p> </blockquote> <p>But it says nothing about dynamic projects running in maven build environment :)! Do anyone has a solution for that problem?</p> <p>Cheers,</p> <p>Kevin</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload