Requirements

The plugin execution requires :
  • Java 1.5 (as Tapestry 5 do)
  • Maven 2+ (tested on 2.0.10 and 2.2.1)

Usage

Setting up tapestry-tldgen requires 2 minutes :

  • Carefully javadoc your component classes and their attributes annotated with @Parameter (already done i hope, isn't it ? :))
  • Open the pom.xml in your library project
  • Paste the following configuration is your plugins descriptor :
         
        <plugin>
            <groupId>fr.exanpe</groupId>
            <artifactId>tapestry-tldgen</artifactId>
            <version>${set the version here}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>tld-generate</goal>
                    </goals>
                    <phase>process-classes</phase>
                    <configuration>
                        <uri>${set your tld uri here}</uri>
                        <namespace>${set your tld defaut namespace here}</namespace>
                        <rootPackage>${set your root package here}</rootPackage>
                        <encoding>${set your source file encoding here}</encoding>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        
                
  • Run a build and get your tld from target/ folder

Configuration

Configuration key required Description
uri true The uri of your taglib
rootPackage true The root package to scan the components. Do not append "components" in the end, root only is required.
namespace false The namespace of the taglib. Default is "t" .
encoding false The source file encoding. Default is your plateform encoding
outputFile false The tld file location. Default is ${project.build.directory}/${project.build.finalName}.tld

Tld exploitation

To benefit of the tld information in your tml coding, execute the instruction on the following page :
Tapestry 5 and JSP Editor for Eclipse