Author: snicoll
Date: Sun Mar  1 15:37:29 2009
New Revision: 749046

URL: http://svn.apache.org/viewvc?rev=749046&view=rev
Log:
MEAR-100: Activated altDeploymentDescriptor for 1.3 and 1.4

Added:
    
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/
    
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/
    
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/application.xml
    
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/pom.xml
Modified:
    
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
    
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java

Modified: 
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java?rev=749046&r1=749045&r2=749046&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
 (original)
+++ 
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
 Sun Mar  1 15:37:29 2009
@@ -206,8 +206,6 @@
      * to the application's root directory.
      *
      * @return the alternative deployment descriptor for this module
-     *
-     * @since JavaEE 5
      */
     public String getAltDeploymentDescriptor()
     {
@@ -231,16 +229,16 @@
 
     /**
      * Writes the alternative deployment descriptor if necessary.
-     * <p/>
-     * Only writes it if the descriptor is specified and version is JavaEE 5.
      *
-     * @param writer the writer to use
+     * @param writer  the writer to use
      * @param version the java EE version in use
      */
-    protected void writeAltDeploymentDescriptor( XMLWriter writer, String 
version) {
-        if (GenerateApplicationXmlMojo.VERSION_5.equals(version) && 
getAltDeploymentDescriptor() != null) {
-            writer.startElement( ALT_DD);
-            writer.writeText( getAltDeploymentDescriptor());
+    protected void writeAltDeploymentDescriptor( XMLWriter writer, String 
version )
+    {
+        if ( getAltDeploymentDescriptor() != null )
+        {
+            writer.startElement( ALT_DD );
+            writer.writeText( getAltDeploymentDescriptor() );
             writer.endElement();
         }
     }

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt?rev=749046&r1=749045&r2=749046&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt Sun Mar  1 
15:37:29 2009
@@ -111,7 +111,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
 
 * {ejbModule} Properties
@@ -145,7 +145,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
 
 * {jarModule} Properties
@@ -179,7 +179,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
   * <<includeInApplicationXml>> - set to true to if you want to generate an 
entry
   of this module in <<<application.xml>>>. Default is false.
@@ -216,7 +216,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
 
 * {rarModule} Properties
@@ -250,7 +250,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
 
 * {sarModule} Properties
@@ -315,7 +315,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
   * <<contextRoot>> - sets the context root of this web artifact.
 
@@ -351,7 +351,7 @@
   to its uri. Default is false.
 
   * <<altDeploymentDescriptor>> - sets the alternative deployment descriptor 
for
-  this module. (Java EE5).
+  this module.
 
 
 * {harModule} Properties

Modified: 
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java?rev=749046&r1=749045&r2=749046&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java
 (original)
+++ 
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java
 Sun Mar  1 15:37:29 2009
@@ -595,4 +595,14 @@
         doTestProject( "project-055", new String[]{"jar-sample-one-1.0.jar", 
"jar-sample-two-1.0.jar",
             "jar-sample-three-with-deps-1.0.jar"} );
     }
+
+    /**
+     * Builds an EAR with deployment descriptor configuration for J2EE 1.4 and
+     * an alternative deployment descriptor.
+     */
+    public void testProject056()
+        throws Exception
+    {
+        doTestProject( "project-056", new String[]{"ejb-sample-one-1.0.jar"} );
+    }
 }

Added: 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/application.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/application.xml?rev=749046&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/application.xml
 (added)
+++ 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/expected-META-INF/application.xml
 Sun Mar  1 15:37:29 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<application xmlns="http://java.sun.com/xml/ns/j2ee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"; version="1.4">
+  <display-name>maven-ear-plugin-test-project-056</display-name>
+  <module>
+    <ejb>ejb-sample-one-1.0.jar</ejb>
+    <alt-dd>sample-one-ejb-jar.xml</alt-dd>
+  </module>
+</application>
\ No newline at end of file

Added: 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/pom.xml?rev=749046&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-056/pom.xml
 Sun Mar  1 15:37:29 2009
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>ear</groupId>
+  <artifactId>maven-ear-plugin-test-project-056</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <packaging>ear</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-one</artifactId>
+      <version>1.0</version>
+      <type>ejb</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>         
+          <encoding>UTF-8</encoding>
+          <version>1.4</version>
+          <modules>
+            <ejbModule>
+              <groupId>eartest</groupId>
+              <artifactId>ejb-sample-one</artifactId>
+              
<altDeploymentDescriptor>sample-one-ejb-jar.xml</altDeploymentDescriptor>
+            </ejbModule>
+          </modules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>


Reply via email to