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

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

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

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->

<!--

    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>project</artifactId>
        <version>2.4.0</version>
    </parent>
    
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <packaging>jar</packaging>
    
    <name>Mojarra ${project.version}</name>
    
    <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"/>
                                    <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><![CDATA[]]></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>generate-sources</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>generate-resources</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>
                    
                    <!-- 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>3.0.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <configuration>
                            <excludePackageNames>com</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>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </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</id>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                    
                        <Bundle-SymbolicName>org.glassfish.javax.faces</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Bundle-Name>Mojarra JSF Implementation ${project.version}</Bundle-Name>
                        <Bundle-Description>Mojarra JSF Implementation (javax.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>Oracle America, Inc.</Implementation-Vendor> 
                        <Implementation-Vendor-Id>com.sun</Implementation-Vendor-Id>
                        
                        <!--  
                        <Include-Resource>META-INF=build/classes/META-INF,build/classes</Include-Resource> 
                        -->
                        <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>
            
            
            <!-- ###  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 -->
        
        <!-- Servlet 4 dependency overriding Java EE 7 main dependency -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Expression Language 3.0.1 overriding Java EE 7 main dependency  -->
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <version>3.0.1-b04</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
            <version>3.0.1-b04</version>
        </dependency>
    
        <!-- The main dependency against which Mojarra 2.3 is created: Java EE 7 -->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>com.sun.faces.build</groupId>
            <artifactId>jsf-tools</artifactId>
            <version>2.4.0</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>
