<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
	   
-->
<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>

  <name>Apache MyFaces Trinidad Impl</name>
  <description>Private implementation of the Apache MyFaces Trinidad project</description>

  <parent>
    <groupId>org.apache.myfaces.trinidad</groupId>
    <artifactId>trinidad</artifactId>
    <version>2.2.1</version>
  </parent>

  <artifactId>trinidad-impl</artifactId>
  <packaging>jar</packaging>

  <dependencies>

    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-servlet_3.0_spec</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jsp_2.1_spec</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-el_2.2_spec</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.portlet</groupId>
      <artifactId>portlet-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.portlet-bridge</groupId>
      <artifactId>portlet-bridge-api</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
    </dependency>

    <!--dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-api</artifactId>
      <scope>provided</scope> 
    </dependency-->
    
    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.buildtools</groupId>
      <artifactId>myfaces-builder-annotations</artifactId>
    </dependency>
      
    <dependency>
      <groupId>org.apache.myfaces.trinidad</groupId>
      <artifactId>trinidad-build</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.trinidad</groupId>
      <artifactId>trinidad-api</artifactId>
    </dependency>
    
     <dependency> 	 
       <groupId>commons-codec</groupId> 	 
       <artifactId>commons-codec</artifactId>
       <scope>compile</scope> 	 
     </dependency>

    <!--dependency>
      <groupId>com.sun.facelets</groupId>
      <artifactId>jsf-facelets</artifactId>
    </dependency-->

    <!-- "test" scope dependencies -->
    <dependency>
      <groupId>org.apache.myfaces.trinidad</groupId>
      <artifactId>trinidad-api</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.test</groupId>
      <artifactId>myfaces-test22</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    
    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock</artifactId>
    </dependency>

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

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>test</scope>
    </dependency>

    <!--dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-impl</artifactId>
      <scope>test</scope>
    </dependency-->

  </dependencies>

  <build>
    <plugins>
      <plugin>
          <groupId>org.apache.myfaces.buildtools</groupId>
          <artifactId>myfaces-builder-plugin</artifactId>
          <executions>
              <execution>
                  <goals>
                      <goal>build-metadata</goal>
                  </goals>
              </execution>
              <!-- TODO: This execution uses myfaces-builder-plugin to generate
              jsp tag classes. Note it only generates component tag classes, not
              converter and validator ones (there are other goals on builder
              plugin to do that). The generated stuff can be compared using a diff
              tool against maven-faces-plugin generated files. For now the intention
              is just test if myfaces-builder-plugin integration is working well and
              it is possible to use it to generate custom components extending from
              trinidad. See TRINIDAD-1409 for details. 
              <execution>
                <id>make_tags</id>
                <configuration>
                    <modelIds>
                        <modelId>trinidad-api</modelId>
                    </modelIds>
                    <jsfVersion>20</jsfVersion>
                    <templateTagName>trinidadTagClass20.vm</templateTagName>
                    <packageContains>org.apache.myfaces.trinidadinternal</packageContains>
                </configuration>
                <goals>
                    <goal>make-tags</goal>
                </goals>
              </execution>
              -->
              <!--
                <execution>
                  <id>make_trinidad_tr</id>
                  <configuration>
                      <xmlFile>META-INF/tr.taglib.xml</xmlFile>
                      <xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
                      <templateFile>facelets-taglib20.vm</templateFile>
                      <params>
                         <shortname>tr</shortname>
                         <uri>http://myfaces.apache.org/trinidad</uri>
                      </params>
                      <modelIds>
                          <modelId>trinidad-api</modelId>
                          <modelId>trinidad-impl</modelId>
                      </modelIds>
                  </configuration>
                  <goals>
                      <goal>make-config</goal>
                  </goals>
                </execution>
                <execution>
                  <id>make_trinidad_trh</id>
                  <configuration>
                      <xmlFile>META-INF/trh.taglib.xml</xmlFile>
                      <xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
                      <templateFile>facelets-taglib20.vm</templateFile>
                      <params>
                         <shortname>trh</shortname>
                         <uri>http://myfaces.apache.org/trinidad/html</uri>
                      </params>
                      <modelIds>
                          <modelId>trinidad-api</modelId>
                          <modelId>trinidad-impl</modelId>
                      </modelIds>
                  </configuration>
                  <goals>
                      <goal>make-config</goal>
                  </goals>
                </execution>
                -->
          </executions>
      </plugin>
          
      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-jdev-plugin</artifactId>
        <configuration>
          <sourceRoots>
            <sourceRoot>src/main/java-templates/</sourceRoot>
          </sourceRoots>
          <resourceRoots>
            <resourceRoot>src/main/javascript/</resourceRoot>
          </resourceRoots>
          <projectHasTests>true</projectHasTests>
          <testSourceRoots>
            <file>${project.basedir}/src/test</file>
          </testSourceRoots>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <!-- Trinidad currently fails proper HTML ID validity,
		 and rather badly - so turn that test off -->
            <property>
              <name>org.apache.myfaces.trinidad.TestIdValidity</name>
              <value>false</value>
            </property>
            <!-- Trinidad currently puts a lot of block-elements inside
		 of inline elements - so turn that test off too -->
            <property>
              <name>org.apache.myfaces.trinidad.TestBlockElementNesting</name>
              <value>false</value>
            </property>
            <property>
              <name>trinidad.renderkit.fulltests</name>
              <value>strict</value> <!-- the other value is "lenient" -->
            </property>
            <property>
              <name>trinidad.renderkit.scripts</name>
              <value>${project.basedir}/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/</value>
            </property>
            <property>
              <name>trinidad.renderkit.golden</name>
              <value>${project.basedir}/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/</value>
            </property>
            <property>
              <name>trinidad.renderkit.failures</name>
              <value>${project.basedir}/target/test-failures/</value>
            </property>
            <property>
              <name>java.awt.headless</name>
              <value>true</value>
            </property>
          </systemProperties>
          <includes implementation="java.util.ArrayList">
            <include implementation="java.lang.String">**/*Test.java</include>
          </includes>
        </configuration>
      </plugin>

      <!-- 
          To make the current version of maven available through a property (maven.version),
          the build-helper-maven-plugin can be used.
      -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>maven-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- 
          To make the current revision number, we use the buildnumber-maven-plugin.
      -->
      <!--plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.0-beta-4</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
          <buildNumberPropertyName>scm.revision</buildNumberPropertyName>
        </configuration>
      </plugin-->

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
         <archive>
           <manifest>
             <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
             <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
           </manifest>
           <manifestEntries>
             <Revision>${scm.revision}</Revision>
             <Maven-Version>${maven.version}</Maven-Version>
             <Java-Vendor>${java.vendor}</Java-Vendor>
             <Os-Name>${os.name}</Os-Name>
             <Os-Arch>${os.arch}</Os-Arch>
             <Os-Version>${os.version}</Os-Version>
           </manifestEntries>
         </archive>
       </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-faces-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-api</artifactId>
            <version>${project.version}</version>
           </dependency>
         </dependencies>
         <configuration>
          <taglibs>
            <tr>http://myfaces.apache.org/trinidad</tr>
            <trh>http://myfaces.apache.org/trinidad/html</trh>
          </taglibs>
          <faceletHandlerClass>org.apache.myfaces.trinidadinternal.facelets.TrinidadComponentHandler</faceletHandlerClass>
          <faceletConverterHandlerClass>org.apache.myfaces.trinidadinternal.facelets.TrinidadConverterHandler</faceletConverterHandlerClass>
          <faceletValidatorHandlerClass>org.apache.myfaces.trinidadinternal.facelets.TrinidadValidatorHandler</faceletValidatorHandlerClass>
          <typePrefix>org.apache</typePrefix>
          <renderKitPrefix>org.apache</renderKitPrefix>
          <packageContains>org.apache</packageContains>
          <removeRenderers>true</removeRenderers>
          <jsfVersion>${jsf-spec.version}</jsfVersion>
          <force>true</force>
        </configuration>
        <executions>
          <execution>
            <id>generate-config</id>
            <goals>
              <goal>generate-faces-config</goal>
              <goal>generate-jsp-taglibs</goal>
              <!--
              <goal>generate-facelets-taglibs</goal>
              -->
            </goals>
            <configuration>
              <generatedSourceDirectory>${project.build.directory}/generated-sources/maven-faces-plugin</generatedSourceDirectory>
              <generatedResourcesDirectory>${project.build.directory}/generated-resources/maven-faces-plugin</generatedResourcesDirectory>
            </configuration>
          </execution>
          <execution>
            <id>generate-renderer-map</id>
            <goals>
              <goal>generate-renderer-map</goal>
            </goals>
            <configuration>
              <generatedSourceDirectory>${project.build.directory}/generated-resources/maven-faces-plugin</generatedSourceDirectory>
              <generatedResourcesDirectory>${project.build.directory}/generated-resources/maven-faces-plugin</generatedResourcesDirectory>
            </configuration>
          </execution>
          <execution>
            <id>generate-facelets-taglibs</id>
            <goals>
              <goal>generate-facelets-taglibs</goal>
            </goals>
            <configuration>
              <generatedResourcesDirectory>src/main/resources</generatedResourcesDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-i18n-plugin</artifactId>
        <configuration>
          <force>true</force>
          <targetPath>META-INF/adf/jsLibs/resources</targetPath>
        </configuration>
        <executions>
          <execution>
            <id>generate-locale</id>
            <goals>
              <goal>generate-locale-elements</goal>
            </goals>
            <configuration>
                <targetDirectory>${project.build.directory}/generated-sources/maven-i18n-plugin</targetDirectory>
            </configuration>
          </execution>
          <execution>
            <id>generate-javascript-locales</id>
            <goals>
              <goal>generate-javascript-locales</goal>
            </goals>
            <configuration>
                <targetDirectory>${project.build.directory}/generated-resources/maven-i18n-plugin</targetDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-javascript-plugin</artifactId>
        <configuration>
          <sourcePath>META-INF/adf/jsLibs</sourcePath>
          <targetPath>META-INF/adf/jsLibsDebug</targetPath>
          <optimizeTargetPath>META-INF/adf/jsLibs</optimizeTargetPath>
          <force>true</force>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>reduce-javascript</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-xrts-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-sources</goal>
              <goal>generate-test-sources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-pmd-plugin</artifactId>
              <version>2.6</version>
              <configuration>
                <targetJdk>${jdk.version}</targetJdk>
              </configuration>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- Excludes the Golden files -->
            <exclude>src/test/resources/*/</exclude>
            <!-- Exclude a directory that jdev sometimes adds, should not be checked in -->            
            <exclude>/src/webapp/</exclude>
            <exclude>src/main/resources/META-INF/trinidad-version.txt</exclude>
            <exclude>src/main/resources/META-INF/servlets/resources/adf.resources</exclude>
            <exclude>src/main/resources/META-INF/tr.taglib.xml</exclude>
            <exclude>src/main/resources/META-INF/trh.taglib.xml</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>    
  </build>
</project>
