<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<!--

    Project to create the Mojarra implementation jar.
    
    This depends on [mojarra home]/jsf-tools being build first (mvn build install).
    
    (note that the jsf-tools jar is only used during the build phase and has no runtime usage)

 -->
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <parent>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-project</artifactId>
        <version>2.3.9.SP03</version>
    </parent>

    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <packaging>jar</packaging>

    <name>JSF Reference Implementation</name>
    <description>JSF (JSR 372) Reference Implementation</description>

    <scm>
        <connection>scm:git:git@github.com:jboss/mojarra.git</connection>
        <developerConnection>scm:git:git@github.com:jboss/mojarra.git</developerConnection>
        <url>https://github.com/jboss/mojarra.git</url>
      <tag>2.3.9.SP03</tag>
  </scm>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <mojarra.logstrings.version>${project.version}</mojarra.logstrings.version>
    </properties>
    
    <build>
        <plugins>
        
            <!-- Use ANT to drive much of our custom build steps -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    
                    
                    <!-- ###  G E N E R A T E   S O U R C E S  ### -->
                    
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target>
                                <property name="jsf-tools-dir" value="${project.build.directory}/../../jsf-tools" />
                                
                                 <echo message="${line.separator}${line.separator}${line.separator}${line.separator} * * * G E N E R A T E S O U R C E S${line.separator}${line.separator}${line.separator}${line.separator}" />
                                
                                <!--
                                
                                    Generate standard-html-renderkit.xml
                                    
                                    This works by taking /jsf-api/doc/standard-html-renderkit-base.xml
                                    which contains a lot of xincludes, and then writing out a new file
                                    called standard-html-renderkit.xml with the xincludes replaced by the
                                    actual file contents.
                                    
                                    (p.s. in a way this is compensating for components in faces-config not 
                                    being able to use inheritance)
                                
                                    -->
                                <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
                                <condition property="osfamily" value="unix">
                                    <or>
                                        <os family="mac" />
                                        <os family="unix" />
                                    </or>
                                </condition>
                                <if>
                                    <equals arg1="${osfamily}" arg2="unix-non" />
                                    <then>
                                        
                                        <!-- 
                                            Copy a lot of -props.xml files to -attrs.xml.
                                            
                                            This is done because by convention the properties of
                                            components are often mirrored as attributes on their
                                            associated default renderers.
                                         -->
                                        <copy todir="src/main/doc" overwrite="true">
                                            <mapper type="glob" from="*-props.xml" to="*-attrs.xml" />
                                            <fileset dir="src/main/doc">
                                                <include name="*-props.xml" />
                                                <exclude name="actionsource-props.xml" />
                                                <exclude name="actionsource2-props.xml" />
                                                <exclude name="editable-props.xml" />
                                                <exclude name="valueholder-props.xml" />
                                                <exclude name="ui*-props.xml" />
                                                <include name="outcometargetbutton-props.xml" />
                                            </fileset>
                                        </copy>
                                        
                                        <!-- 
                                            Global search for "property" tags in the newly copied -attrs.xml files and replace
                                            by "attribute" tags
                                            -->
                                        <replace dir="src/main/doc" summary="true">
                                            <include name="*-attrs.xml" />
                                            <replacefilter token="&lt;property" value="&lt;attribute" />
                                            <replacefilter token="&lt;/property" value="&lt;/attribute" />
                                            <replacefilter token="Properties" value="Attributes" />
                                        </replace>
                                        
                                        <!--
                                            Use the xmllint commandline tool to do the actual inclusion of the xincludes
                                            and write out the file with the include directives replaced by their
                                            respective content.
                                            -->
                                        <exec executable="xmllint" dir="src/main/doc" failonerror="true">
                                            <arg line="--xinclude --format --output standard-html-renderkit.xml standard-html-renderkit-base.xml" />
                                        </exec>
                                        
                                        <!--
                                            Add a warning that the file is generated and should not be edited manually.
                                            -->
                                        <replace file="src/main/doc/standard-html-renderkit.xml">
                                            <replacetoken><![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]></replacetoken>
                                            <replacevalue><![CDATA[<?xml version="1.0" encoding="UTF-8"?>

<!-- DO NOT EDIT     DO NOT EDIT    DO NOT EDIT    DO NOT EDIT    DO NOT EDIT -->]]>
                                            </replacevalue>
                                        </replace>
                                        <replace file="src/main/doc/standard-html-renderkit.xml">
                                            <replacetoken><![CDATA[<component xmlns:xi="http://www.w3.org/2001/XInclude">]]></replacetoken>
                                            <replacevalue><![CDATA[<component>]]></replacevalue>
                                        </replace>
                                        <delete>
                                            <fileset dir="src/main/doc" includes="*-attrs.xml" />
                                        </delete>
                                        <move file="src/main/doc/standard-html-renderkit.xml" tofile="src/main/resources/com/sun/faces/standard-html-renderkit.xml" />
                                    </then>
                                </if>
                          
                                    
                               
                               
                                <!--
                                
                                    Generate AttributeManager
                                    
                                    AttributeManager is a class that contains mappings between the standard components
                                    and the passthrough attributes associated with them.
                                    
                                    This is used in the generating of several UI components based on their taglib descriptions
                                
                                    -->
                                <echo message="Copying LogStrings.properties" />
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="LogStrings.properties" />
                                </copy>
                                
                                <echo message="Copying *.dtd,*.xsd" />
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" flatten="true" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="*.dtd,*.xsd" />
                                </copy>
                                
                                <taskdef name="generateAttrManager" classname="com.sun.faces.ant.AttributeManagerGenTask">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                    </classpath>
                                </taskdef>
                                <generateAttrManager generatorConfig="${jsf-tools-dir}/conf/HtmlBasicTaglib21.properties" facesConfig="src/main/resources/com/sun/faces/standard-html-renderkit.xml" fork="true">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                        <pathelement location="${jsf-tools-dir}/build/classes" />
                                        <path refid="maven.plugin.classpath" />
                                    </classpath>
                                </generateAttrManager>
                                
                                <copy todir="${project.build.directory}/generated-sources/antrun">
                                    <fileset dir="build/generate" />
                                </copy>
                                <delete dir="build" />
                                <delete dir="${jsf-tools-dir}/build" />
                                
                                
                                <echo message="${line.separator}${line.separator}Generate com.sun.faces.renderkit.html_basic sources${line.separator}${line.separator}" />
                                <!--
                                
                                    Generate com.sun.faces.renderkit.html_basic sources
                                    
                                    -->
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="LogStrings.properties" />
                                </copy>
                                
                                <echo message="Copying *.dtd,*.xsd" />
                                
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" flatten="true" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="*.dtd,*.xsd" />
                                </copy>
                                
                                <echo message="Copying TAG-*" />
                                
                                <copy todir="build" verbose="true">
                                    <fileset dir="${jsf-tools-dir}/conf">
                                        <include name="TAG-*" />
                                    </fileset>
                                </copy>
                                
                                <echo message="generateTaglib" />
                                
                                <taskdef name="generateTaglib" classname="com.sun.faces.ant.TaglibGenTask">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                        <pathelement location="${jsf-tools-dir}/build/classes/" />
                                    </classpath>
                                </taskdef>
                                <generateTaglib generatorConfig="${jsf-tools-dir}/conf/HtmlBasicTaglib21.properties" facesConfig="src/main/resources/com/sun/faces/standard-html-renderkit.xml" fork="true">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                        <pathelement location="${jsf-tools-dir}/build/classes/" />
                                        <path refid="maven.plugin.classpath" />
                                    </classpath>
                                </generateTaglib>
                                
                                <copy todir="${project.build.directory}/generated-sources/antrun/com" verbose="true">
                                    <fileset dir="build/generate/com" />
                                </copy>
                                
                                <echo message="deleting build" />
                                
                                <delete dir="build" />
                                <delete dir="${jsf-tools-dir}/build" />
                                
                                
                                <echo message="${line.separator}${line.separator}${line.separator}${line.separator}Generate API components${line.separator}${line.separator}${line.separator}${line.separator}" />
                                <!--
                                
                                    Generate API components
                                    
                                -->
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="LogStrings.properties" />
                                </copy>
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" flatten="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="*.dtd,*.xsd" />
                                </copy>
                                
                                <taskdef name="generateComponents" classname="com.sun.faces.ant.ComponentGenTask">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                    </classpath>
                                </taskdef>
                                <generateComponents generatorConfig="${jsf-tools-dir}/conf/HtmlBasicTaglib21.properties" facesConfig="src/main/resources/com/sun/faces/standard-html-renderkit.xml" fork="true">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                        <pathelement location="${jsf-tools-dir}/build/classes" />
                                        <path refid="maven.plugin.classpath" />
                                    </classpath>
                                </generateComponents>
                                
                                <copy todir="${project.build.directory}/generated-sources/antrun/javax">
                                    <fileset dir="build/generate/javax" />
                                </copy>
                                <delete dir="build" />
                                <delete dir="${jsf-tools-dir}/build" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                                 
                                        
                    
                    <!-- ###  G E N E R A T E   R E S O U R C E S  ### -->                    
                    
                    <execution>
                        <id>generate-resources</id>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <property name="jsf-tools-dir" value="${project.build.directory}/../../jsf-tools" />
                                
                                 <echo message="${line.separator}${line.separator}${line.separator}${line.separator} * * * G E N E R A T E R E S O U R C E S${line.separator}${line.separator}${line.separator}${line.separator}" />
                                
                                
                                <!--
                                
                                    Copy LogStrings
                                
                                -->
                                <mkdir dir="${project.build.directory}/generated-resources/antrun" />
                                <copy todir="${project.build.directory}/generated-resources/antrun/com/sun/faces" overwrite="true" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="LogStrings*.properties" />
                                </copy>
                                <!-- 
                                    Replace the version placeholder in the LogStrings, so that the right
                                    project version is used to print to log at startup                                
                                 -->
                                <replace dir="${project.build.directory}/generated-resources/antrun" token="|version.string|" value="${mojarra.logstrings.version}">
                                    <include name="**/LogStrings*.properties" />
                                </replace>
                                
                                
                                <!--
                                
                                    Generate META-INF/html_basic.tld
                                    
                                -->
                                <copy todir="build">
                                    <fileset dir="${jsf-tools-dir}/conf">
                                        <include name="TAG-*" />
                                    </fileset>
                                </copy>
                                
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" verbose="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="LogStrings.properties" />
                                </copy>
                                <copy todir="${jsf-tools-dir}/build/classes/com/sun/faces" flatten="true">
                                    <fileset dir="src/main/resources/com/sun/faces" includes="*.dtd,*.xsd" />
                                </copy>
                                
                                <taskdef name="generateTaglib" classname="com.sun.faces.ant.TaglibGenTask">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/build/classes" />
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                    </classpath>
                                </taskdef>
                                <generateTaglib generatorConfig="${jsf-tools-dir}/conf/HtmlBasicTaglib21.properties" facesConfig="src/main/resources/com/sun/faces/standard-html-renderkit.xml" fork="true">
                                    <classpath>
                                        <pathelement location="${jsf-tools-dir}/target/jsf-tools-${project.version}.jar" />
                                        <pathelement location="${jsf-tools-dir}/build/classes" />
                                        <path refid="maven.plugin.classpath" />
                                    </classpath>
                                </generateTaglib>
                                
                                <copy file="build/generate/conf/share/html_basic.tld" toDir="${project.build.directory}/generated-resources/antrun/META-INF" />
                                      
                                <delete dir="build" />
                                <delete dir="${jsf-tools-dir}/build" />
                                
                                
                                <!--
                                
                                    Generate jsf(-uncompressed).js
                                
                                -->
                                <mkdir dir="${project.build.directory}/generated-resources/antrun/META-INF/resources/javax.faces" />
                                <concat destfile="${project.build.directory}/generated-resources/antrun/META-INF/resources/javax.faces/jsf-uncompressed.js" fixlastline="yes">
                                    <filelist dir="src/main/js">
                                        <file name="jsf.js" />
                                    </filelist>
                                    <filelist dir="src/main/js">
                                        <file name="mojarra.js" />
                                    </filelist>
                                </concat>
                                <get src="https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar" dest="yuicompressor.jar" usetimestamp="true" skipexisting="true" />
                                <java jar="yuicompressor.jar" fork="true" failonerror="true" args="-o ${project.build.directory}/generated-resources/antrun/META-INF/resources/javax.faces/jsf.js ${project.build.directory}/generated-resources/antrun/META-INF/resources/javax.faces/jsf-uncompressed.js" />
                                
                                
                                <!--
                                
                                    Generate jsf-ri-runtime.xml
                                
                                -->
                                <xslt in="src/main/resources/com/sun/faces/standard-html-renderkit.xml" out="merged.xml" style="${jsf-tools-dir}/src/main/xsl/merge-config.xsl">
                                </xslt>
                                <replace file="${basedir}/merged.xml">
                                    <replacetoken><![CDATA[xmlns:jsf="http://xmlns.jcp.org/xml/ns/javaee"]]></replacetoken>
                                    <replacevalue />
                                </replace>
                                <replace file="${basedir}/merged.xml">
                                    <replacetoken><![CDATA[ >]]></replacetoken>
                                    <replacevalue><![CDATA[>]]></replacevalue>
                                </replace>
                                <xslt in="${basedir}/merged.xml" out="${project.build.directory}/generated-resources/antrun/com/sun/faces/jsf-ri-runtime.xml" style="${jsf-tools-dir}/src/main/xsl/prune-tool-data.xsl">
                                </xslt>
                                <replace file="${project.build.directory}/generated-resources/antrun/com/sun/faces/jsf-ri-runtime.xml">
                                    <replacetoken><![CDATA[xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"]]></replacetoken>
                                </replace>
                                <replace file="${project.build.directory}/generated-resources/antrun/com/sun/faces/jsf-ri-runtime.xml">
                                    <replacetoken><![CDATA[ >]]></replacetoken>
                                    <replacevalue><![CDATA[>]]></replacevalue>
                                </replace>
                                <replace file="${project.build.directory}/generated-resources/antrun/com/sun/faces/jsf-ri-runtime.xml">
                                    <replacetoken><![CDATA[<faces-config>]]></replacetoken>
                                    <replacevalue><![CDATA[
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3">]]>
                                    </replacevalue>
                                </replace>
                                <delete file="${basedir}/merged.xml" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                
                <!-- Ant plug-in dependencies -->
                <dependencies>
                    <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>1.0b3</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ant</groupId>
                                <artifactId>ant</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant</artifactId>
                        <version>1.9.6</version>
                    </dependency>
                    <dependency>
                        <groupId>commons-digester</groupId>
                        <artifactId>commons-digester</artifactId>
                        <version>2.1</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.faces.build</groupId>
                        <artifactId>jsf-tools</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            
            <!-- Adds the paths where the source and resources generated above was stored -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/antrun</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/generated-resources/antrun</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            
            
            <!-- ###  C O M P I L E  ### --> 
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                
                <executions>
                    <execution>
                        <id>pre-compile</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    
                    <!-- Process annotation - generate code based on them  -->
                    <execution>
                        <id>process-annotations</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <annotationProcessors>com.sun.faces.generate.PreParseFacesConfigProcessor</annotationProcessors>
                            <generatedSourcesDirectory>${project.build.directory}/generated-sources/antrun</generatedSourcesDirectory>
                            <proc>only</proc>
                        </configuration>
                    </execution>
                    
                    <!-- Compile all Java code, including the code generated above -->
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <proc>none</proc>
                        </configuration>
                    </execution>
                </executions>
                
            </plugin>
            
            
            <!-- ###  C R E A T E    J A V A D O C   ### --> 
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <configuration>
                            <excludePackageNames>javax</excludePackageNames>
                        </configuration>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- ###  C R E A T E    S O U R C E  ### --> 

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <excludes>
                        <exclude>javax/**</exclude>
                        <exclude>com/sun/faces/vendor/GlassFish*</exclude>
                        <exclude>com/sun/faces/vendor/Jetty*</exclude>
                        <exclude>com/sun/faces/vendor/Tomcat*</exclude>
                        <exclude>META-INF/services/com.sun.faces.spi.injectionprovider</exclude>
                        <exclude>META-INF/mojarra-jsf-api-probe-provider.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <overwrite>true</overwrite>
                </configuration>
            </plugin>

            <!-- Generate the META-INF/MANIFEST.MF file for OSGi use -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.4.0</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                        </manifest>
                        <manifest>
                            <addDefaultImplementationEntries>false</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                    <instructions>

                        <Bundle-SymbolicName>org.glassfish.jakarta.faces</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Bundle-Name>Mojarra JSF Implementation ${project.version}</Bundle-Name>
                        <Bundle-Description>Mojarra JSF Implementation (jakarta.faces/2.3) ${project.version}</Bundle-Description>

                        <Specification-Title>JavaServer Faces</Specification-Title>
                        <Specification-Version>2.3</Specification-Version>

                        <Implementation-Title>Mojarra</Implementation-Title>
                        <Implementation-Version>${project.version}</Implementation-Version>
                        <Implementation-Vendor>Eclipse</Implementation-Vendor>
                        <Implementation-Vendor-Id>org.glassfish</Implementation-Vendor-Id>

                        <Extension-Name>javax.faces</Extension-Name>

                        <Export-Package>
                            javax.faces.*;version=2.3,
                            com.sun.faces.*;version=2.3
                        </Export-Package>

                        <Import-Package>
                            javax.faces.*,
                            com.sun.faces.*,
                            javax.servlet.annotation.*;resolution:=optional,
                            javax.servlet.*,
                            javax.el.*,
                            javax.inject.*,
                            javax.enterprise.inject.*,
                            javax.enterprise.util.*,
                            javax.enterprise.context.*,
                            javax.annotation.processing.*,
                            javax.annotation.*;version="[1.0.0,2.0.0)",
                            javax.crypto.*,
                            javax.websocket.*;resolution:=optional,
                            javax.json.*;resolution:=optional,
                            javax.validation.*;resolution:=optional,
                            javax.enterprise.event;resolution:=optional,
                            javax.ejb.*;resolution:=optional,
                            javax.persistence.*;resolution:=optional,
                            javax.xml.*,
                            org.w3c.dom.*,
                            com.sun.enterprise.*;resolution:=optional,
                            org.mortbay.jetty.annotations;resolution:=optional,
                            org.mortbay.jetty.plus.annotation;resolution:=optional,
                            org.apache.*;resolution:=optional,
                            org.jboss.weld.*;resolution:=optional,
                            org.xml.sax.*,
                            javax.naming.*
                        </Import-Package>
                        <!--
                            Allow Mojarra to load alternative AnnotationProvider, FaceletConfigResourceProvider,
                            FacesConfigResourceProvider, CDIUtil, and ApplicationConfigurationPopulator SPI
                            implementations. Mojarra provides default implementations, so each capability is marked as
                            optional.
                        -->
                        <Require-Capability>
                            osgi.serviceloader;filter:="(osgi.serviceloader=com.sun.faces.spi.AnnotationProvider)";
                            resolution:=optional;cardinality:=multiple,
                            osgi.serviceloader;filter:="(osgi.serviceloader=com.sun.faces.spi.FaceletConfigResourceProvider)";
                            resolution:=optional;cardinality:=multiple,
                            osgi.serviceloader;filter:="(osgi.serviceloader=com.sun.faces.spi.FacesConfigResourceProvider)";
                            resolution:=optional;cardinality:=multiple,
                            osgi.serviceloader;filter:="(osgi.serviceloader=com.sun.faces.util.cdi11.CDIUtil)";
                            resolution:=optional;cardinality:=multiple,
                            osgi.serviceloader;filter:="(osgi.serviceloader=javax.faces.application.ApplicationConfigurationPopulator)";
                            resolution:=optional;cardinality:=multiple,
                            osgi.extender;filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional
                        </Require-Capability>
                        <Provide-Capability>
                            osgi.extender;osgi.extender="jsp.taglib";uri="http://java.sun.com/jsf/html";
                            version:Version="2.3",
                            osgi.extender;osgi.extender="jsp.taglib";uri="http://java.sun.com/jsf/core";
                            version:Version="2.3"
                        </Provide-Capability>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <excludes>
                        <exclude>javax/**</exclude>
                        <exclude>com/sun/faces/vendor/GlassFish*</exclude>
                        <exclude>com/sun/faces/vendor/Jetty*</exclude>
                        <exclude>com/sun/faces/vendor/Tomcat*</exclude>
                        <exclude>META-INF/services/com.sun.faces.spi.injectionprovider</exclude>
                        <exclude>META-INF/mojarra-jsf-api-probe-provider.xml</exclude>
                    </excludes>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            
            <!-- ###  V A L I D A T I O N  ### --> 
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <targetJdk>1.8</targetJdk>
                    <excludes>
                        <exclude>com/sun/faces/taglib/html_basic/**/*.java</exclude>
                        <exclude>javax/faces/component/html/**/*.java</exclude>
                    </excludes>
                    <rulesets>
                        <ruleset>${project.build.directory}/../src/main/pmd/ruleset.xml</ruleset>
                    </rulesets>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>net.sourceforge.pmd</groupId>
                        <artifactId>pmd</artifactId>
                        <version>5.1.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>2.8</version>
                <dependencies>
                    <dependency>
                        <groupId>com.google.code.findbugs</groupId>
                        <artifactId>bcel-findbugs</artifactId>
                        <version>6.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.4</version>
                <configuration>
                    <threshold>High</threshold>
                    <excludeFilterFile>${project.build.directory}/../src/main/findbugs/exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            
            <!-- Validate that the various XML files are well formed and match their schema-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <basedir>src/main/resources/com/sun/faces</basedir>
                    <validationSets>
                        <validationSet>
                            <dir>src/main/resources/com/sun/faces</dir>
                            <includes>
                                <include>*.xsd</include>
                                <include>standard-html-renderkit.xml</include>
                            </includes>
                        </validationSet>
                    </validationSets>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.8</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    
    <!-- ###  D E P E N D E N C I E S  ### --> 
    
    <dependencies>
        <!-- Java EE Dependencies -->

        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_4.0_spec</artifactId>
            <version>1.0.0.Final</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.servlet.jsp</groupId>
            <artifactId>jboss-jsp-api_2.3_spec</artifactId>
            <version>1.0.3.Final</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.servlet.jstl</groupId>
            <artifactId>jboss-jstl-api_1.2_spec</artifactId>
            <version>1.1.4.Final</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.websocket</groupId>
            <artifactId>jboss-websocket-api_1.1_spec</artifactId>
            <version>1.1.3.Final</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.el</artifactId>
            <version>3.0.2</version>
            <scope>provided</scope>
        </dependency>
    
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0.SP1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.1.Final</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.1.2</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.2_spec</artifactId>
            <version>1.0.1.Final</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        
        <dependency>
            <groupId>com.sun.faces.build</groupId>
            <artifactId>jsf-tools</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <!--
            For the vendor SPI implementations shipped with Mojarra.
            See package com.sun.faces.vendor
            TODO: Is this really needed still? These are extremely old
         -->

         <!-- Jetty 6 -->
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-plus</artifactId>
            <version>6.1.26</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-annotations</artifactId>
            <version>6.1.26</version>
            <optional>true</optional>
        </dependency>

        <!-- Tomcat 6 -->
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>catalina</artifactId>
            <version>6.0.51</version>
            <scope>provided</scope>
        </dependency>

        
        <!-- TEST DEPENDENCIES -->
        
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>javax.el</artifactId>
            <version>2.2.3</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymockclassextension</artifactId>
            <version>3.1</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-easymock</artifactId>
            <version>1.4.11</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>1.4.11</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <includes>javax/**/*.java</includes>
                    <configLocation>${project.build.directory}/../checkstyle-config.xml</configLocation>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <targetJdk>1.8</targetJdk>
                    <excludes>
                        <exclude>com/sun/faces/taglib/html_basic/**/*.java</exclude>
                        <exclude>javax/faces/component/html/**/*.java</exclude>
                    </excludes>
                    <rulesets>
                        <ruleset>${project.build.directory}/../src/main/pmd/ruleset.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <includes>
                        <include>javax/faces/**</include>
                    </includes>
                    <comparisonArtifacts>
                        <comparisonArtifact>
                            <groupId>org.glassfish</groupId>
                            <artifactId>javax.faces</artifactId>
                            <version>2.3.0-m09</version>
                        </comparisonArtifact>
                    </comparisonArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.4</version>
                <configuration>
                    <threshold>High</threshold>
                    <excludeFilterFile>${project.build.directory}/../src/main/findbugs/exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>2.4</version>
            </plugin>
        </plugins>
    </reporting>
    
</project>
