Using Classpath Resolvers

Classpath resolvers allow you to keep all your .html and .properties files next to the java source files. We believe that this is a very efficient way to work, especially with large projects.

Installing Classpath Resolvers

The classpath resolvers are not enabled by default. To enable them, you'll need to add the following configurations to your hivemind files.

    <implementation service-id="tapestry.page.SpecificationResolverDelegate">
       <invoke-factory>
           <construct class="net.sf.tacos.resolvers.ClasspathSpecResolverDelegate">
                <set-object property="classFinder" value="infrastructure:classFinder"/>
           </construct>
       </invoke-factory>
   </implementation>
   

  <implementation service-id="tapestry.page.ComponentSpecificationResolver">
    Locates the specification for a component or page.
    <invoke-factory model="threaded">
      <construct class="net.sf.tacos.resolvers.ClasspathComponentSpecResolver">
        <set-object property="specificationSource" value="infrastructure:specificationSource"/>
        <set-service property="delegate" service-id="tapestry.page.SpecificationResolverDelegate"/>
        <set-object property="applicationId" value="infrastructure:applicationId"/>
        <set-object property="contextRoot" value="infrastructure:contextRoot"/>
        <set-object property="classFinder" value="infrastructure:classFinder"/>
      </construct>
    </invoke-factory>
  </implementation>            

Maven 2 and Classpath Resolvers

If you're using maven for your builds, you may have to instruct it where to find the Tapestry artifacts. Use something like this:

    <build>
    
        ...

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>

            ...

        </resources>

        ...

    </build>