You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2006/08/02 22:43:16 UTC

svn commit: r428140 - in /maven/plugins/trunk/maven-ear-plugin/src: main/java/org/apache/maven/plugin/ear/WebModule.java site/apt/modules.apt site/fml/faq.fml

Author: snicoll
Date: Wed Aug  2 13:43:15 2006
New Revision: 428140

URL: http://svn.apache.org/viewvc?rev=428140&view=rev
Log:
MEAR-29: Added ability to deactivate <context-root> generation to be compliant with portlet deployment.

Modified:
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java
    maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
    maven/plugins/trunk/maven-ear-plugin/src/site/fml/faq.fml

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java?rev=428140&r1=428139&r2=428140&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java Wed Aug  2 13:43:15 2006
@@ -39,6 +39,8 @@
 
     private String contextRoot;
 
+    private Boolean noContextRoot = Boolean.FALSE;
+
     public WebModule()
     {
     }
@@ -56,9 +58,14 @@
         writer.startElement( WEB_URI_FIELD );
         writer.writeText( getUri() );
         writer.endElement(); // web-uri
-        writer.startElement( CONTEXT_ROOT_FIELD );
-        writer.writeText( getContextRoot() );
-        writer.endElement(); // context-root
+
+        // If noContextRoot is true, skip the generation of
+        // the context-root element
+        if (!noContextRoot.booleanValue()) {
+            writer.startElement( CONTEXT_ROOT_FIELD );
+            writer.writeText( getContextRoot() );
+            writer.endElement(); // context-root
+        }
         writer.endElement(); // web
         writer.endElement(); // module
     }

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=428140&r1=428139&r2=428140&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 Wed Aug  2 13:43:15 2006
@@ -266,6 +266,8 @@
 
   * <<contextRoot>> - sets the context root of this web artifact.
 
+  * <<noContextRoot>> - specify if the context root element should be generated.
+
 
 * {wsrModule} Properties
 

Modified: maven/plugins/trunk/maven-ear-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/fml/faq.fml?rev=428140&r1=428139&r2=428140&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/fml/faq.fml (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/fml/faq.fml Wed Aug  2 13:43:15 2006
@@ -39,6 +39,18 @@
        </p>
      </answer>
    </faq>
+   <faq id="portlet">
+     <question>
+       The EAR Plugin always generate a 'context-root' element for web applications and it does not work with
+       portlet deployment. How do we solve this issue?
+     </question>
+     <answer>
+       <p>
+         Simply configure the web module by specifying the 'noContextRoot' boolean parameter. If this parameter
+         is true, the 'context-root' element is not generated for the related web module.
+       </p>
+     </answer>
+   </faq>
  </part>
 </faqs>