Apache MyFaces
Project Documentation
Foundation

Configuration files (faces-config.xml, .tld, facelets taglib)

All configuration files are generated by make-config goal.

This goal can be seen as an equation:

     xmlBaseFile + templateFile( model(s) to take in consideration ) = xmlFile

It is enought flexible to generate any file based on the model. Some examples can be seen below.

          ............ plugin declaration goes before ...........
          <!-- faces-config -->
          <execution>
            <id>makefacesconfig</id>
            <configuration>
                <templateFile>faces-config12.vm</templateFile>
                <xmlFile>META-INF/faces-config.xml</xmlFile>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>
          
          <!-- tld -->
          <execution>
            <id>maketomahawktld</id>
            <configuration>
                <xmlFile>META-INF/tomahawk.tld</xmlFile>
                <xmlBaseFile>src/main/conf/META-INF/tomahawk-base.tld</xmlBaseFile>
                <templateFile>tomahawk12.vm</templateFile>
                <params>
                   <shortname>t</shortname>
                   <uri>http://myfaces.apache.org/tomahawk</uri>
                   <displayname>Tomahawk tag library 1.2.</displayname>
                </params>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>
          
          <!-- facelets taglib -->        
          <execution>
            <id>maketomahawktaglib</id>
            <configuration>
                <xmlFile>META-INF/tomahawk.taglib.xml</xmlFile>
                <xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
                <templateFile>facelets-taglib.vm</templateFile>
                <params>
                   <shortname>t</shortname>
                   <uri>http://myfaces.apache.org/tomahawk</uri>
                </params>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>
          .................