You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ws...@apache.org on 2008/03/23 00:23:32 UTC

svn commit: r640119 - /maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml

Author: wsmoak
Date: Sat Mar 22 16:23:31 2008
New Revision: 640119

URL: http://svn.apache.org/viewvc?rev=640119&view=rev
Log:
MWAR-131 Added a faq explaining the new attachClasses parameter as well as the existing archiveClasses parameter.

Modified:
    maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml

Modified: maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml?rev=640119&r1=640118&r2=640119&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml (original)
+++ maven/plugins/trunk/maven-war-plugin/src/site/fml/faq.fml Sat Mar 22 16:23:31 2008
@@ -74,5 +74,48 @@
        </p>
      </answer>
    </faq>
+   <faq id="attached">
+     <question>How do I create a jar containing the classes in my webapp?</question>
+       <answer>
+       <p>If you would simply like to package the classes and resources  as a jar in WEB-INF/lib
+           rather than as loose files under WEB-INF/classes, use the following configuration:</p>
+       <p>
+         <source>
+           <plugin>
+             <artifactId>maven-war-plugin</artifactId>
+             <version>X.Y</version>
+             <configuration>
+               <archiveClasses>true</archiveClasses>
+             </configuration>
+           </plugin>
+         </source>
+       </p>
+       <p>If you need to re-use this jar in another project, the recommended approach is to move the classes to a
+       separate module that builds a jar, and then declare a dependency on that jar from your webapp as well as from
+       any other projects that need it.</p>
+       <p>If you can't move the classes to another project, you can deploy the classes and resources included in
+           your webapp as an "attached" artifact, with a classifier, by using the following configuration:</p>
+       <p>
+         <source>
+         <project>
+           ...
+           <artifactId>mywebapp</artifactId>
+           <version>1.0-SNAPSHOT</version>
+           ...
+               <plugin>
+                 <artifactId>maven-war-plugin</artifactId>
+                 <version>X.Y</version>
+                 <configuration>
+                   <attachClasses>true</attachClasses>
+                 </configuration>
+               </plugin>
+             ...
+           </project>
+         </source>
+       </p>
+       <p>This will result in two artifacts being deployed:  mywebapp-1.0-SNAPSHOT.war
+       and mywebapp-1.0-SNAPSHOT-classes.jar</p>
+     </answer>
+   </faq>
  </part>
 </faqs>