Add support for including XML files from inside the component-metadata portion of the faces-config and added support for multiple event-name tags so that they can be imported and later merged
diff --git a/maven-faces-plugin/pom.xml b/maven-faces-plugin/pom.xml
index bb055ad..4045202 100644
--- a/maven-faces-plugin/pom.xml
+++ b/maven-faces-plugin/pom.xml
@@ -55,30 +55,23 @@
     <dependency>
       <groupId>commons-digester</groupId>
       <artifactId>commons-digester</artifactId>
-      <version>1.7</version>
-    </dependency>
-    <dependency>
-      <groupId>saxon</groupId>
-      <artifactId>saxon</artifactId>
-      <version>6.5.3</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-      <version>2.6.2</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>stax</groupId>
-      <artifactId>stax-api</artifactId>
-      <version>1.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>stax</groupId>
-      <artifactId>stax</artifactId>
-      <version>1.2.0_rc2-dev</version>
+      <version>1.8.1</version>
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.myfaces.trinidadbuild</groupId>
+        <artifactId>maven-jdev-plugin</artifactId>
+        <configuration>
+          <projectHasTests>true</projectHasTests>
+          <testSourceRoots>
+            <file>${project.basedir}/src/test</file>
+          </testSourceRoots>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
index fd6e4fd..9d17ae3 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
@@ -322,13 +322,21 @@
 
   public void parseEventNames(String value)
   {
-    if (value == null)
+    if (value != null)
     {
-      _eventNames = null;
-    }
-    else
-    {
-      _eventNames = value.trim().split("\\s+");
+      String[] names = value.trim().split("\\s+");
+      // combine event names if given more than once (to make importing from another XML file more easy)
+      if (_eventNames == null)
+      {
+        _eventNames = names;
+      }
+      else
+      {
+        String[] currEventNames = _eventNames;
+        _eventNames = new String[_eventNames.length + names.length];
+        System.arraycopy(currEventNames, 0, _eventNames, 0, currEventNames.length);
+        System.arraycopy(names, 0, _eventNames, currEventNames.length, names.length);
+      }
     }
   }
 
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index a3884a2..99bc23c 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -84,7 +84,7 @@
     SAXParserFactory spf = SAXParserFactory.newInstance();
     spf.setNamespaceAware(true);
     // requires JAXP 1.3, in JavaSE 5.0
-    // spf.setXIncludeAware(true);
+    //spf.setXIncludeAware(true);
     Digester digester = new Digester(spf.newSAXParser());
     digester.setNamespaceAware(true);
 
@@ -229,6 +229,10 @@
                               ComponentIncludeFactory.class);
     digester.addFactoryCreate("faces-config/component/property/include",
                               ComponentPropertyIncludeFactory.class);
+    digester.addFactoryCreate("faces-config/component/component-extension/include",
+                              ComponentIncludeFactory.class);
+    digester.addFactoryCreate("faces-config/component/component-extension/component-metadata/include",
+                              ComponentIncludeFactory.class);
   }
 
   // Add component property-related digster rules
diff --git a/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml b/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml
index 6bfc9ca..070d086 100644
--- a/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml
+++ b/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml
@@ -16,35 +16,35 @@
     KIND, either express or implied.  See the License for the

     specific language governing permissions and limitations

     under the License.

-	   

+

 -->

 <faces-config xmlns="http://java.sun.com/xml/ns/javaee"

               xmlns:af="http://myfaces.apache.org/trinidad"

               xmlns:xi="http://www.w3.org/2001/XInclude"

               xmlns:md="http://myfaces.apache.org/bali/xml/metadata"

-              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin" >

+              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin">

 

-  <component>  

-  

+  <component>

+

     <component-type>org.apache.myfaces.trinidad.Command</component-type>

     <component-class>org.apache.myfaces.trinidad.component.UIXCommand</component-class>

 

     <description>

       A base abstraction for components that implement ActionSource.

     </description>

-    

+

     <xi:include href="TestInclude.xml" xpointer="/faces-config/component/*"></xi:include>

 

     <property>

       <property-name>action</property-name>

       <property-class>javax.faces.el.MethodBinding</property-class>

       <description><![CDATA[

-      

+

           The reference to the Java method that will be invoked when

           an ActionEvent is broadcast by this component. The method

           signature takes a single ActionEvent parameter and returns

           void.

-          

+

           Test to make sure that markup in a pre block is escaped.

           <pre>

             <af:commandButton />

@@ -53,7 +53,7 @@
             <af:commandButton />

           </pre>

 

-      ]]>    

+      ]]>

       </description>

       <property-extension>

         <mfp:state-holder>true</mfp:state-holder>

@@ -70,12 +70,12 @@
       <property-name>actionListener</property-name>

       <property-class>javax.faces.el.MethodBinding</property-class>

       <description><![CDATA[

-      

+

           The reference to the Java method that will be invoked when

           an ActionEvent is broadcast by this component.  The method

           signature takes a single ActionEvent parameter and returns

           void.

-      ]]>    

+      ]]>

       </description>

       <property-extension>

         <mfp:state-holder>true</mfp:state-holder>

@@ -110,11 +110,11 @@
     <property>

       <property-name>immediate</property-name>

       <property-class>boolean</property-class>

-      <description>a reference to an action method sent by the command component, 

-           or the static outcome of an action.  When immediate is true, the 

-           default ActionListener provided by the JavaServer Faces implementation 

-           should be executed during Apply Request Values phase of the request 

-           processing lifecycle, rather than waiting until the Invoke Application 

+      <description>a reference to an action method sent by the command component,

+           or the static outcome of an action.  When immediate is true, the

+           default ActionListener provided by the JavaServer Faces implementation

+           should be executed during Apply Request Values phase of the request

+           processing lifecycle, rather than waiting until the Invoke Application

            phase.

       </description>

       <property-extension>

@@ -123,11 +123,11 @@
     </property>

 

     <property>

-      <description><![CDATA[the visibility of the component.  If it is "false", the component will 

-      be hidden on the client.  Unlike "rendered", this does not affect the lifecycle on the server 

-      - the component may have its bindings executed, etc. - and the visibility of the component can 

-      be toggled on and off on the client, or toggled with PPR.  When "rendered" is false, the 

-      component will not in any way be rendered, and cannot be made visible on the client. 

+      <description><![CDATA[the visibility of the component.  If it is "false", the component will

+      be hidden on the client.  Unlike "rendered", this does not affect the lifecycle on the server

+      - the component may have its bindings executed, etc. - and the visibility of the component can

+      be toggled on and off on the client, or toggled with PPR.  When "rendered" is false, the

+      component will not in any way be rendered, and cannot be made visible on the client.

       In most cases, use the "rendered" property instead of the "visible" property.]]>

       </description>

       <property-name>visible</property-name>

@@ -137,7 +137,7 @@
         <mfp:required>false</mfp:required>

         <mfp:unsupported-render-kits>org.apache.myfaces.trinidad.core</mfp:unsupported-render-kits>

         <mfp:property-metadata>

-          <mfp:deprecated>The "visible" attribute has been deprecated.  

+          <mfp:deprecated>The "visible" attribute has been deprecated.

             Use the af:showPopupBehavior tag or the show/hide methods on the popup client component.

           </mfp:deprecated>

           <mfp:no-op/>