You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by ev...@apache.org on 2005/03/07 22:46:14 UTC
cvs commit: maven-components/maven-core-it/it0016/src/main/webapp index.html
evenisse 2005/03/07 13:46:14
Modified: maven-core-it integration-tests.txt
maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war
WarMojo.java
Added: maven-core-it/it0016/src/main/webapp/WEB-INF web.xml
maven-core-it/it0016/src/main/webapp index.html
Log:
Initial version of war plugin.
Revision Changes Path
1.18 +1 -0 maven-components/maven-core-it/integration-tests.txt
Index: integration-tests.txt
===================================================================
RCS file: /home/cvs/maven-components/maven-core-it/integration-tests.txt,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- integration-tests.txt 7 Mar 2005 08:54:14 -0000 1.17
+++ integration-tests.txt 7 Mar 2005 21:46:14 -0000 1.18
@@ -12,3 +12,4 @@
it0013
#it0014
it0015
+it0016
\ No newline at end of file
1.4 +14 -9 maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
Index: WarMojo.java
===================================================================
RCS file: /home/cvs/maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WarMojo.java 5 Mar 2005 14:52:11 -0000 1.3
+++ WarMojo.java 7 Mar 2005 21:46:14 -0000 1.4
@@ -82,7 +82,7 @@
* required="true"
* validator=""
* expression="#maven.war.src"
- * default="#basedir/src/webapp"
+ * default="#basedir/src/main/webapp"
* description=""
* @parameter
* name="warSourceIncludes"
@@ -93,7 +93,7 @@
* default="**"
* description=""
* @parameter
- * name="warSourceIncludes"
+ * name="warSourceExcludes"
* type="String"
* required="false"
* validator=""
@@ -112,7 +112,7 @@
* required="true"
* validator=""
* expression="#maven.war.webapp.dir"
- * default="#project.build.output/#project.build.finalName"
+ * default="#project.build.directory/#project.build.finalName"
* description=""
* @parameter
* name="mode"
@@ -128,7 +128,7 @@
* required="true"
* validator=""
* expression="#maven.war.build.dir"
- * default="#project.build.output"
+ * default="#project.build.directory"
* description=""
* @parameter
* name="basedir"
@@ -157,7 +157,7 @@
public class WarMojo
extends AbstractPlugin
{
- public static final String WEB_INF = "WEB_INF";
+ public static final String WEB_INF = "WEB-INF";
private PluginExecutionRequest request;
@@ -190,7 +190,8 @@
if ( warSourceDirectory.exists() )
{
- FileUtils.copyDirectory( sourceDirectory, webappDirectory, includes, excludes );
+ //TODO : Use includes and excludes
+ FileUtils.copyDirectoryStructure( sourceDirectory, webappDirectory );
}
if ( webXml != null && ! "".equals( webXml ) )
@@ -281,11 +282,15 @@
MavenArchiver archiver = new MavenArchiver();
- //archiver.setArchiver( new WarArchiver() );
+ WarArchiver warArchiver = new WarArchiver();
+
+ archiver.setArchiver( warArchiver );
archiver.setOutputFile( warFile );
- archiver.getArchiver().addDirectory( webappDirectory, new String[] { "**/**" }, null );
+ warArchiver.addDirectory( webappDirectory, new String[] { "**/**" }, new String[] { "**/WEB-INF/web.xml" } );
+
+ warArchiver.setWebxml( new File( webappDirectory, "WEB-INF/web.xml" ) );
// create archive
archiver.createArchive( request );
1.1 maven-components/maven-core-it/it0016/src/main/webapp/WEB-INF/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app >
</web-app>
1.1 maven-components/maven-core-it/it0016/src/main/webapp/index.html
Index: index.html
===================================================================
<html>
<body>
Hello World
</body>
</html>