<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.apache.myfaces.tomahawk</groupId>
  <artifactId>tomahawk</artifactId>
  <packaging>jar</packaging>
  <name>Tomahawk Core</name>
  <description>
    JSF components and utilities that can be used with any JSF implementation.
    This library is compatible with both JSF1.1 and JSF1.2; however for JSF1.2 users there
    is an alternative build of Tomahawk available that takes advantage of JSF1.2 features to
    offer some additional benefits.
  </description>

  <parent>
    <groupId>org.apache.myfaces.tomahawk</groupId>
    <artifactId>tomahawk-project</artifactId>
    <version>1.1.15-SNAPSHOT</version>
  </parent>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core</developerConnection>
    <url>http://svn.apache.org/viewcvs.cgi/myfaces/tomahawk/trunk/core</url>
  </scm>

  <dependencies>

    <!-- compile dependencies -->

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>compile</scope>
    </dependency>
    

    <dependency>
      <groupId>commons-validator</groupId>
      <artifactId>commons-validator</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <scope>compile</scope>
    </dependency>

    <!-- Transitive dependency from commons-fileupload.
    in 1.2 it was declared optional, but t:inputFileUpload
    uses it indirectly, so it is necessary to include it
    in our pom as runtime dependency  -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>struts</groupId>
      <artifactId>struts</artifactId>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-core</artifactId>
      <scope>compile</scope>
      <optional>true</optional>        
    </dependency>

    <dependency>
      <groupId>commons-el</groupId>
      <artifactId>commons-el</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>oro</groupId>
      <artifactId>oro</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.1.0</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>batik</groupId>
      <artifactId>batik-awt-util</artifactId>
    </dependency>   

    <!-- provided dependencies -->

    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-api</artifactId>
      <version>${myfaces-core11-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.shared</groupId>
      <artifactId>myfaces-shared-tomahawk</artifactId>
      <version>${myfaces-shared11-version}</version>
      <scope>provided</scope> <!-- because we add all classes to the jar directly -->
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.3</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>portlet-api</groupId>
      <artifactId>portlet-api</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
      <groupId>com.sun.facelets</groupId>
      <artifactId>jsf-facelets</artifactId>
      <scope>provided</scope>
    </dependency>
        
    <!-- Required for wrapper of FacesContext (compatible with 1.2) -->
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-el_1.0_spec</artifactId>
    </dependency>    

    <!-- test dependencies -->

    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-impl</artifactId>
      <version>${myfaces-core11-version}</version>
      <!--
        Since Tomahawk must stay compatible to other JSF implementations we
        must not have any (compile time) dependency on myfaces-impl other than
        test classes.
      -->
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>cactus</groupId>
      <artifactId>cactus</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>easymock</groupId>
      <artifactId>easymock</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.shale</groupId>
      <artifactId>shale-test</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.myfaces</groupId>
          <artifactId>myfaces-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.myfaces</groupId>
          <artifactId>myfaces-impl</artifactId>
        </exclusion>
        <exclusion>
          <groupId>myfaces</groupId>
          <artifactId>myfaces-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>myfaces</groupId>
          <artifactId>myfaces-impl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock-cglib</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>maven-taglib</groupId>
      <artifactId>maven-taglib-plugin</artifactId>
      <scope>test</scope>
    </dependency>   

  </dependencies>

  <build>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
           <exclude>**/*.vm</exclude>
           <exclude>**/AddResource.properties</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>src/main/resources-filtered</directory>
        <filtering>true</filtering>
      </resource>
      
      <!-- 
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
         -->
            <!-- Used in the resources URL, to enable caching the 
               resources on the client.
               See MyfacesResourceLoader.getLastModified() -->
               <!-- 
            <include>**/AddResource.properties</include>
        </includes>
        <excludes>
           <exclude>**/*.vm</exclude>
        </excludes>
      </resource>
       -->
      <!--       
      <resource>
        <directory>src/main/resources-facesconfig</directory>
      </resource>
       -->
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <manifestEntries>
                <X-Compile-Source-JDK>1.4</X-Compile-Source-JDK>
                <X-Compile-Target-JDK>1.4</X-Compile-Target-JDK>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <!-- Used in the resources URL, to enable caching the 
           resources on the client.
           See MyfacesResourceLoader.getLastModified() -->      
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.0-beta-1</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <buildNumberPropertyName>tomahawk.lastModified</buildNumberPropertyName>
          <format>{0,date,yyyy-MM-dd HH:mm:ss Z}</format>
          <items>
            <item>timestamp</item>
          </items>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.myfaces.buildtools</groupId>
        <artifactId>myfaces-builder-plugin</artifactId>
        <version>${myfaces-builder-plugin-version}</version>
        <executions>
          <execution>
            <!-- A hierarchy of different tag classes must be created, 
            because this classes are not part of the public api. The
            generation of all html package is the same. Please note that
            we need only a subset -->
            <configuration>
                <replacePackagePrefixTagFrom>org.apache.myfaces.taglib</replacePackagePrefixTagFrom>
                <replacePackagePrefixTagTo>org.apache.myfaces.shared_tomahawk.taglib</replacePackagePrefixTagTo>
            </configuration>
            <goals>
              <goal>build-metadata</goal>
            </goals>
          </execution>
          <execution>
            <id>makefacesconfig</id>
            <configuration>
                <xmlFile>META-INF/faces-config.xml</xmlFile>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>
          <execution>
            <id>makecomp</id>
            <goals>
              <goal>make-components</goal>
            </goals>
          </execution>
          <execution>
            <id>makeval</id>
            <goals>
              <goal>make-validators</goal>
            </goals>
          </execution>
          <execution>
            <id>make_tags_myfaces_core</id>
            <configuration>
                <packageContains>org.apache.myfaces.shared_tomahawk.taglib</packageContains>
                <typePrefix>javax.faces</typePrefix>
                <modelIds>
                    <!-- All the info needed is on myfaces-api package -->
                    <modelId>myfaces-api</modelId>
                </modelIds>
            </configuration>
            <goals>
                <goal>make-tags</goal>
            </goals>
          </execution>
          <execution>
            <id>make_tags_tomahawk</id>
            <goals>
                <goal>make-tags</goal>
            </goals>
          </execution>
          <execution>
            <id>make_validator_tags_tomahawk</id>
            <goals>
                <goal>make-validator-tags</goal>
                <goal>make-converter-tags</goal>
            </goals>
          </execution>          
          <execution>
            <id>maketomahawktld</id>
            <configuration>
                <xmlFile>META-INF/tomahawk.tld</xmlFile>
                <xmlBaseFile>src/main/conf/META-INF/tomahawk-base.tld</xmlBaseFile>
                <templateFile>tomahawk.vm</templateFile>
                <params>
                   <shortname>t</shortname>
                   <uri>http://myfaces.apache.org/tomahawk</uri>
                   <displayname>Tomahawk tag library.</displayname>
                   <description> MyFaces subproject that contains components and other goodies to be used with any JSF implementation.</description>
                </params>
                <modelIds>
                    <modelId>tomahawk</modelId>
                </modelIds>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>        
          <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>
                <modelIds>
                    <modelId>tomahawk</modelId>
                </modelIds>
            </configuration>
            <goals>
                <goal>make-config</goal>
            </goals>
          </execution>        
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.2</version>
        <configuration>
          <excludes>
            <exclude>**/Abstract*.java</exclude>
            <exclude>**/*HtmlDateRendererTest*</exclude>
            <exclude>**/TestUtils.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>unpack-shared-tomahawk</id>
            <phase>process-classes</phase>
            <goals><goal>unpack</goal></goals>
            <configuration>
              <excludes>META-INF/*.*</excludes>
              <artifactItems>
                <artifactItem>
                   <groupId>org.apache.myfaces.shared</groupId>
                   <artifactId>myfaces-shared-tomahawk</artifactId>
                   <version>${myfaces-shared11-version}</version>
                 </artifactItem>
               </artifactItems>
               <outputDirectory>${project.build.directory}/classes</outputDirectory>
            </configuration>
          </execution>
          <!-- unpack the shared sources into target/shared_sources-->
          <execution>
            <id>unpack-shared-impl-sources</id>
            <phase>process-sources</phase>
            <goals>
                <goal>unpack</goal>
            </goals>
            <configuration>
                <excludes>META-INF/*.*</excludes>
                <artifactItems>
                    <artifactItem>
                        <groupId>org.apache.myfaces.shared</groupId>
                        <artifactId>myfaces-shared-tomahawk</artifactId>
                        <version>${myfaces-shared11-version}</version>
                        <classifier>sources</classifier>
                    </artifactItem>
                </artifactItems>
                <outputDirectory>${project.build.directory}/shared_sources</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- the following will add the unpacked shared sources directory as source directory into the pom,
           so also the shared sources are automaticaly included by the attach source plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>process-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/shared_sources</source>
                <source>${project.build.directory}/generated-sources/myfaces-builder-plugin</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-source</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.4</source>
          <target>1.4</target>
        </configuration>
      </plugin>
    </plugins>

  </build>

  <reporting>

    <plugins>

      <plugin>
        <artifactId>maven-changelog-plugin</artifactId>
        <version>2.2</version>
        <reportSets>
          <reportSet>
            <id>dual-report</id>
            <configuration>
              <type>range</type>
              <range>30</range>
            </configuration>
            <reports>
              <report>changelog</report>
              <report>file-activity</report>
              <report>dev-activity</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.8</version>
      </plugin>

      <plugin>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.3</version>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.0</version>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.4</version>
      </plugin>

    </plugins>

  </reporting>

  <profiles>
    <profile>
      <id>generate-site</id>
      <build>
        <plugins>
          <plugin>
            <!-- Generate content for custom tagdoc report -->
            <groupId>org.apache.myfaces.buildtools</groupId>
            <artifactId>myfaces-builder-plugin</artifactId>
            <version>${myfaces-builder-plugin-version}</version>
            <configuration>
              <taglibs>
                <t>http://myfaces.apache.org/tomahawk</t>
              </taglibs>
            </configuration>
            <executions>
              <execution>
                <goals><goal>tagdoc-content</goal></goals>
              </execution>
            </executions>
          </plugin>          
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>net.sourceforge.maven-taglib</groupId>
            <artifactId>maven-taglib-plugin</artifactId>
            <configuration>
              <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
              <tldDocDir>${basedir}/target/site/tlddoc</tldDocDir>
            </configuration>
          </plugin>
          <plugin>
            <!-- which goal is run here? -->
            <groupId>org.apache.myfaces.buildtools</groupId>
            <artifactId>myfaces-builder-plugin</artifactId>
            <version>${myfaces-builder-plugin-version}</version>
            <configuration>
              <taglibs>
                <t>http://myfaces.apache.org/tomahawk</t>
              </taglibs>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <!--
        - Build and install into the repository some additional artifacts that we don't
        - want to build during normal development because they take too long.
        -->
      <id>generate-assembly</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <!-- Install in the repository a "-javadoc.jar" file -->
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals><goal>jar</goal></goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <!-- Install in the repository a "-tlddoc.jar" file -->
            <groupId>net.sourceforge.maven-taglib</groupId>
            <artifactId>maven-taglib-plugin</artifactId>
            <configuration>
              <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
              <tldDocDir>${basedir}/target/tlddoc</tldDocDir>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals><goal>taglibdocjar</goal></goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <!-- Install in the repository a "-sources.jar" file -->
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-source</id>
                <goals><goal>jar</goal></goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
