Maven tomcat:run goal and jsf annotation based component/converter/validator scanning

jsf components
jsf tutorial
jsf 2.2 tutorial
spring boot primefaces login example
jsf maven

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 <faces-config ... metadata-complete="false"> attribute to false. Now it works but only if I start my application with mvn tomcat:run-war goal and not with the mvn tomcat:run dynamic project, which is more comfortable for development. The specification of JSP 2.0 says that:

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.

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.

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.

But it says nothing about dynamic projects running in maven build environment :)! Do anyone has a solution for that problem?



I also had this problem, but found that adding the war:inplace goal made it work for me. i.e. use

mvn clean war:inplace tomcat:run

instead of just 'tomcat:run' and it should work just fine.

Facelets and JSF 1.1 maven-faces-plugin Getting started , This tells the facelets annotation deployment that you wish to scan this JAR and, in this example, that you wish to force the registration of classes  2 Maven tomcat:run goal and jsf annotation based component/converter/validator scanning Aug 21 '12 1 Globus Toolkit virtual machine Nov 1 '10 1 Image comparison algorithm Apr 19 '11

In my case the Log4jServletContainerInitializer in log4j-web was somehow preventing the FacesInitializer in javax.faces from being called, which is responsible for processing annotated JSF classes.

Using tomcat8-maven-plugin and embedded tomcat 8.0.52.

war:inplace worked, or just removing log4j-web (with manual log4j initialization and context management).

JoinFaces Reference Guide, Component starter for BootsFaces JSF Component library. Not using Tomcat or Mojarra Spring Boot based applications — especially when using jar -​packaging Maven plugin to configure a classpath scan at build-time in order to for converters. joinfaces.myfaces.cdi-managed-validators-enabled=  JSF Example Using JSF 2.0, eclipse, and maven June 22, 2014 by Mukesh Kumar at 3:47 pm In this article I will show you how to create a simple JavaServer Faces (JSF) Web application starting from zero with Eclipse and Maven.

Adding org.apache.myfaces.annotation.SCAN_PACKAGES fixed the tomcat7:run goal for me

Developing JSF Applications With Spring Boot, JSF is a solid specification for web app UI development. Faces (JSF) is a Java specification that promotes component-based user to scan for configurations on non-classical web applications (i.e. on or through the mvn spring-boot:run command, we will be able to reach it in <goal>toolchain</goal>. JavaServer Faces is a server side component framework for building Java Technology web-based application.JavaServer Faces (JSF) consists of two main parts: The JavaServer Faces API for representing components, managing their states, handling events, handling server side validations, and achieving data conversion; defining pages navigation, supporting internationalization and accessibility and

JavaServer Faces 2.3 Quick Reference, Until JSF 2.3, there were a few tricks to obtain validators/converters eligible for injection: Validator), and @FacesBehavior (javax.faces.component.behavior. The JSF managed bean annotations will be deprecated in JSF 2.3. Via this function call, the end‐user can execute JSF AJAX requests. JSF - PrimeFaces Hello World Example using Jetty and Maven 5 minute read PrimeFaces is an open source component library for JavaServer Faces (JSF). It provides a collection of mostly visual components (widgets) that can be used by JSF programmers to build the UI for a web application.

JSF - Quick Guide, This plugin enables the developers to run maven commands within eclipse Further information about configuring and running Tomcat can be found in the During this phase, JSF processes all validators registered on the component tree. In the following example, we'll create a maven-based web application project in  In this tutorial, let us see how to create a simple hello world web application using JSF 2.x MVC framework in eclipse with maven support. JavaServer Faces (JSF) is part of the Java Platform, Enterprise Edition, that is used for building component-based user interfaces for web applications.

Core Technologies - Project Metadata API Guide, Fine-tuning Annotation-based Autowiring with Qualifiers; 1.9.5. Validation, Data Binding, and Type Conversion Spring AOP Capabilities and Goals; 5.3. various web framework components such as controllers and JSF-managed beans, With component scanning in the classpath, Spring generates bean names for  To create a simple JSF application, we'll use maven-archetype-webapp plugin. In the following example, we'll create a maven-based web application project in C:\JSF folder. Create Project. Let's open command console, go the C:\ > JSF directory and execute the following mvn command.