
Index: D:/apps/maven-1/plugins/trunk/eclipse/plugin.jelly
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/plugin.jelly	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/plugin.jelly	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -18,7 +18,7 @@
  -->
 
 
-<project 
+<project
   xmlns:j="jelly:core"
   xmlns:ant="jelly:ant"
   xmlns:test="test"
@@ -24,10 +24,11 @@
   xmlns:test="test"
   xmlns:util="jelly:util"
   xmlns:define="jelly:define"
-  xmlns:maven="jelly:maven">
+  xmlns:maven="jelly:maven"
+  >
 
 
-  <define:taglib uri="eclipse">  
+  <define:taglib uri="eclipse">
     <define:tag name="write-classpath-entry">
       <maven:param-check value="${groupId}" fail="true" message="'groupId' must be specified"/>
       <maven:param-check value="${artifactId}" fail="true" message="'artifactId' must be specified"/>
@@ -38,17 +39,20 @@
       <j:if test='${relativePathCheck == "X"}'>
       	<j:set var="relativePath" value="${groupId}/jars/${artifactId}-${version}.jar" />
       </j:if>
+
       <j:set var="mappedsrc" value="${groupId}/src/${artifactId}-${version}.${maven.eclipse.src.extension}"/>
-      <util:file var="checkSrcExist" name="${maven.repo.local}/${mappedsrc}" />
-      <j:choose>
-        <j:when test="${checkSrcExist.exists()}">
-          <classpathentry kind="var" path="MAVEN_REPO/${relativePath}" sourcepath="MAVEN_REPO/${mappedsrc}" />
-        </j:when>
-        <j:otherwise>
-          <classpathentry kind="var" path="MAVEN_REPO/${relativePath}" />
-        </j:otherwise>
-      </j:choose>
+      <j:set var="jdocs" value="${groupId}/javadoc.jars/${artifactId}-${version}.javadoc.jar"/>
+
+      <classpathentry kind="var" path="MAVEN_REPO/${relativePath}" sourcepath="MAVEN_REPO/${mappedsrc}">
+      	<!-- javadoc need to be an absolute path in eclipse 3.1, the MAVEN_REPO var will not work
+      	<attributes>
+			<attribute value="jar:file:/${maven.repo.local}/${jdocs}!/" name="javadoc_location"/>
+		</attributes>
+		-->
+      </classpathentry>
+
     </define:tag>
+
   </define:taglib>
 
   <!--==================================================================-->
@@ -53,7 +57,7 @@
 
   <!--==================================================================-->
   <!-- Generate Eclipse .project and .classpath files                   -->
-  <!--==================================================================-->    
+  <!--==================================================================-->
   <goal name="eclipse"
     description="Generate Eclipse project files"
     prereqs="eclipse:generate-project">
@@ -60,6 +64,17 @@
     <j:if test="${sourcesPresent}">
     	<attainGoal name="eclipse:generate-classpath" />
     </j:if>
+
+    <!-- jelly trick, you can't use "-1" in comparisons -->
+    <j:set var="indexnotfound" value="${0-1}" />
+
+	<!-- another jelly trick, you can't call methods on variables with a dot -->
+    <j:set var="mepn" value="${maven.eclipse.projectnatures}x" />
+
+    <j:if test="${mepn.indexOf('org.eclipse.wst.common.modulecore.ModuleCoreNature') != indexnotfound}">
+    	<attainGoal name="eclipse:generate-wtpmodules" />
+    </j:if>
+
     <ant:echo>Now refresh your project in Eclipse (right click on the project and select "Refresh")</ant:echo>
   </goal>
 
@@ -65,26 +80,50 @@
 
   <goal name="eclipse:generate-project"
     description="Generate Eclipse .project file">
-    
+
     <ant:echo>Creating ${basedir}/.project ...</ant:echo>
+
     <j:file name="${basedir}/.project" prettyPrint="true" xmlns="dummy">
-      <j:import file="${plugin.resources}/templates/project.jelly" inherit="true"/>    
+      <j:import file="${plugin.resources}/templates/project.jelly" inherit="true"/>
     </j:file>
-    
+
   </goal>
-	
+
 
   <!--==================================================================-->
   <!-- Generate Eclipse  .classpath file                                -->
-  <!--==================================================================-->    
+  <!--==================================================================-->
   <goal name="eclipse:generate-classpath"
     description="Generate Eclipse .classpath file">
-  
-    <ant:echo>Creating ${basedir}/.classpath ...</ant:echo>                
+
+    <ant:echo>Creating ${basedir}/.classpath ...</ant:echo>
     <j:file name="${basedir}/.classpath" prettyPrint="true" outputMode="xml" xmlns="dummy">
-      <j:import file="${plugin.resources}/templates/classpath.jelly" inherit="true"/>    
+      <j:import file="${plugin.resources}/templates/classpath.jelly" inherit="true"/>
     </j:file>
-    
+
+  </goal>
+
+
+  <!--==================================================================-->
+  <!-- Generate Eclipse .wtpmodules file                                -->
+  <!--==================================================================-->
+  <goal name="eclipse:generate-wtpmodules"
+    description="Generate Eclipse .wtpmodules file">
+
+    <ant:echo>Creating ${basedir}/.wtpmodules ...</ant:echo>
+    <j:file name="${basedir}/.wtpmodules" prettyPrint="true" outputMode="xml" xmlns="dummy">
+      <j:import file="${plugin.resources}/templates/wtpmodules.jelly" inherit="true"/>
+    </j:file>
+
+
+    <j:set var="runtime" value="${maven.eclipse.runtime}X" />
+    <j:if test='${runtime != "X"}'>
+	    <ant:echo>Creating ${basedir}/.runtime ...</ant:echo>
+	    <j:file name="${basedir}/.runtime" prettyPrint="true" outputMode="xml" xmlns="dummy">
+	      <runtime runtime-id="${maven.eclipse.runtime}" servers="false"/>
+	    </j:file>
+    </j:if>
+
   </goal>
 
 
@@ -101,8 +140,8 @@
     <j:set var="os" value="${os.name}" />
     <j:set var="windows" value="${os.toLowerCase().indexOf('windows') != '-1'}"/>
     <ant:echo>Adapting the generated file for a ${os} box.</ant:echo>
-    
-    <!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... --> 
+
+    <!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... -->
     <j:set var="tool.loc" value="${maven.home}${file.separator}bin${file.separator}maven"/>
     <j:if test="${windows}">
       <j:set var="tool.loc" value="${tool.loc}.bat"/>
@@ -107,7 +146,7 @@
     <j:if test="${windows}">
       <j:set var="tool.loc" value="${tool.loc}.bat"/>
     </j:if>
-    
+
     <j:file name="${toolFile}" prettyPrint="true" xmlns="dummy">
       <externaltools>
         <j:set var="project" value="${org.apache.commons.jelly.werkz.Project}"/>
@@ -144,7 +183,7 @@
         </j:forEach>
       </externaltools>
     </j:file>
-    
+
     <j:set var="ws" value="${maven.eclipse.workspace}X" />
     <j:if test='${ws != "X"}'>
       <j:set var="toDir" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.ui.externaltools/" />
@@ -150,11 +189,11 @@
       <j:set var="toDir" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.ui.externaltools/" />
       <ant:copy file="${toolFile}" todir="${toDir}"/>
     </j:if>
-    
+
     <j:if test='${ws == "X"}'>
       <ant:echo>
   Please set maven.eclipse.workspace to the location of your eclipse workspace.
-  Alternatively, copy 
+  Alternatively, copy
     ${maven.build.dir}/eclipse/externaltools.xml
   to
     [maven.eclipse.workspace]/.metadata/.plugins/org.eclipse.ui.externaltools/externaltools.xml
@@ -175,8 +214,8 @@
     <j:set var="os" value="${os.name}" />
     <j:set var="windows" value="${os.toLowerCase().indexOf('windows') != '-1'}"/>
     <ant:echo>Adapting the generated file for a ${os} box.</ant:echo>
-    
-    <!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... --> 
+
+    <!-- Strangely, j:file inserts a space between ${maven.home} and /bin/maven ... -->
     <j:set var="tool.loc" value="${maven.home}${file.separator}bin${file.separator}maven"/>
     <j:if test="${windows}">
       <j:set var="tool.loc" value="${tool.loc}.bat"/>
@@ -209,7 +248,7 @@
         </j:file>
       </j:if>
     </j:forEach>
-    
+
     <j:set var="ws" value="${maven.eclipse.workspace}X" />
     <j:if test='${ws != "X"}'>
       <j:set var="toDir" value="${maven.eclipse.workspace}/.metadata/.plugins/org.eclipse.debug.core/.launches/" />
@@ -217,11 +256,11 @@
         <ant:fileset dir="${maven.build.dir}/eclipse/" includes="*.launch" />
       </ant:copy>
     </j:if>
-    
+
     <j:if test='${ws == "X"}'>
       <ant:echo>
   Please set maven.eclipse.workspace to the location of your eclipse workspace.
-  Alternatively, copy 
+  Alternatively, copy
     ${maven.build.dir}/eclipse/*.launch
   to
     [maven.eclipse.workspace]/.metadata/.plugins/org.eclipse.debug.core/.launches/
@@ -245,7 +284,7 @@
 	<!-- create the Eclipse property file if it is missing -->
 	<ant:mkdir dir="${variableDir}"/>
         <ant:touch file="${variableFile}"/>
-        
+
         <ant:propertyfile file="${variableFile}">
           <ant:entry key="org.eclipse.jdt.core.classpathVariable.MAVEN_REPO"
             default="${maven.repo.local}" />
@@ -254,19 +293,21 @@
       <j:otherwise>The property $${maven.eclipse.workspace} was not set. MAVEN_REPO may not be set.</j:otherwise>
     </j:choose>
   </goal>
-  
+
   <!--==================================================================-->
   <!-- Clean up eclipse generated files                                 -->
   <!--==================================================================-->
-  <goal name="eclipse:clean" 
+  <goal name="eclipse:clean"
     description="Clean eclipse generated files">
     <j:set var="projectFileName" value="${basedir}/.project"/>
     <j:set var="classpathFileName" value="${basedir}/.classpath"/>
+    <j:set var="wtpmodulesFileName" value="${basedir}/.wtpmodules"/>
 
     <ant:delete file="${projectFileName}"/>
     <ant:delete file="${classpathFileName}"/>
+    <ant:delete file="${wtpmodulesFileName}"/>
 
     <ant:echo>Cleaned up eclipse generated files</ant:echo>
-  </goal>  
+  </goal>
 
 </project>
Index: D:/apps/maven-1/plugins/trunk/eclipse/plugin.properties
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/plugin.properties	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/plugin.properties	(working copy)
@@ -1,12 +1,12 @@
 # -------------------------------------------------------------------
 # Copyright 2001-2004 The Apache Software Foundation.
-# 
+#
 # Licensed 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.
@@ -21,7 +21,7 @@
 # -------------------------------------------------------------------
 
 # Generate Eclipse external tools mappings for the specified goals.
-# This accepts two values: 'all' for all the goals, 
+# This accepts two values: 'all' for all the goals,
 # and 'plugins' to generate only the plugins' default goals.
 maven.eclipse.goals = plugins
 maven.gen.src=${maven.build.dir}/generated-sources
@@ -27,3 +27,5 @@
 maven.gen.src=${maven.build.dir}/generated-sources
 maven.eclipse.src.extension = zip
 maven.eclipse.resources.addtoclasspath=false
+maven.eclipse.servletapilist=servletapi:servletapi,geronimo-spec:geronimo-spec-servlet
+
Index: D:/apps/maven-1/plugins/trunk/eclipse/project.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/project.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/project.xml	(working copy)
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/project.jelly
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/project.jelly	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/project.jelly	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -23,8 +23,30 @@
   xmlns:ant="jelly:ant"
   xmlns="dummy"
   trim="true">
+<projectDescription>
+
+<j:set var="fullprojectnatures" value="${maven.eclipse.projectnatures}" />
+<j:set var="fullbuildcommands" value="${maven.eclipse.buildcommands}" />
+
+  <!-- add java nature/builder only if sources are present. Avoid duplicates -->
   
-<projectDescription>
+  <!-- jelly trick, you can't use "-1" in comparisons -->
+  <j:set var="indexnotfound" value="${0-1}" />
+  
+  <!-- another jelly trick, you can't call methods on variables with a dot -->
+  <j:set var="mepn" value="${maven.eclipse.projectnatures}x" />
+  <j:set var="mebc" value="${maven.eclipse.buildcommands}x" />
+
+  <j:if test="${sourcesPresent}">
+
+    <j:if test="${mepn.indexOf('org.eclipse.jdt.core.javanature') == indexnotfound}">
+      <j:set var="fullprojectnatures" value="org.eclipse.jdt.core.javanature,${maven.eclipse.projectnatures}" />
+    </j:if>
+    <j:if test="${mebc.indexOf('org.eclipse.jdt.core.javabuilder') == indexnotfound}">
+      <j:set var="fullbuildcommands" value="org.eclipse.jdt.core.javabuilder,${maven.eclipse.buildcommands}" />
+    </j:if>
+  </j:if>
+
   <name>${pom.artifactId}</name>
   <comment>${pom.description}</comment>
   <projects>
@@ -29,8 +51,7 @@
   <comment>${pom.description}</comment>
   <projects>
     <j:forEach var="lib" items="${pom.artifacts}">
-      <j:set var="eclipseDependency"
-             value="${lib.dependency.getProperty('eclipse.dependency')}"/>
+      <j:set var="eclipseDependency" value="${lib.dependency.getProperty('eclipse.dependency')}"/>
       <j:if test="${eclipseDependency == 'true'}">
         <project>${lib.dependency.artifactId}</project>
       </j:if>
@@ -38,24 +59,18 @@
   </projects>
   <j:if test="${sourcesPresent}">
   <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-      <arguments>
-      </arguments>
-    </buildCommand>
-    <util:tokenize var="commands" delim=",">${maven.eclipse.buildcommands}</util:tokenize>
+    <util:tokenize var="commands" delim=",">${fullbuildcommands}</util:tokenize>
     <j:forEach var="command" items="${commands}" trim="true">
-    <buildCommand>
-      <name>${command}</name>
-      <arguments/>
-    </buildCommand>
+      <buildCommand>
+        <name>${command}</name>
+        <arguments></arguments>
+      </buildCommand>
     </j:forEach>
   </buildSpec>
   <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-    <util:tokenize var="natures" delim=",">${maven.eclipse.projectnatures}</util:tokenize>
+    <util:tokenize var="natures" delim=",">${fullprojectnatures}</util:tokenize>
     <j:forEach var="nature" items="${natures}" trim="true">
-    <nature>${nature}</nature>
+      <nature>${nature}</nature>
     </j:forEach>
   </natures>
   </j:if>
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/wtpmodules.jelly
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/wtpmodules.jelly	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-resources/templates/wtpmodules.jelly	(revision 0)
@@ -1 +1,130 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    /*
+    * Copyright 2001-2005 The Apache Software Foundation.
+    *
+    * Licensed 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.
+    */
+-->
+<j:whitespace xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:u="jelly:util" xmlns:eclipse="eclipse" xmlns="dummy" trim="true">
+    <project-modules id="moduleCoreId">
+        <j:set var="deployDir" value="/" />
+        <j:set var="moduletype" value="jst.utility" />
+        <j:set var="deployname" value="${pom.artifactId}" />
+        <j:set var="mmpt" value="${maven.multiproject.type}" trim="true" />
+        <j:choose>
+            <j:when test="${mmpt == 'war'}">
+                <!-- war -->
+                <j:set var="moduletype" value="jst.web" />
+                <j:set var="deployDir" value="/WEB-INF/classes" />
+            </j:when>
+        </j:choose>
+        <wb-module deploy-name="${deployname}">
+            <j:choose>
+                <j:when test="${moduletype == 'jst.web'}">
+                    <!-- war -->
+                    <maven:get var="warPath" plugin='maven-war-plugin' property='maven.war.src' />
+                    <maven:makeRelativePath var="relWarPath" basedir="${basedir}" path="${warPath}" separator="/" />
+                    <module-type module-type-id="jst.web">
+                        <version>
+                            <!-- try to detect servlet dependency, maven.eclipse.servletapilist can hold different names -->
+                            <j:set var="moduleversion" value="x" />
+                            <u:tokenize var="servletapilist" delim=",">${maven.eclipse.servletapilist}</u:tokenize>
+                            <j:forEach var="servletapi" items="${servletapilist}" trim="true">
+                                <j:if test="${pom.getDependency(servletapi) != null}">
+                                    <j:set var="moduleversion" value="${pom.getDependency(servletapi).getVersion()}" />
+                                </j:if>
+                            </j:forEach>
+                            <!-- defaults to 2.2 -->
+                            <j:choose>
+                                <j:when test="${moduleversion.startsWith('2.4')}">2.4</j:when>
+                                <j:when test="${moduleversion.startsWith('2.3')}">2.3</j:when>
+                                <j:otherwise>2.2</j:otherwise>
+                            </j:choose>
+                        </version>
+                        <property name="context-root" value="${pom.artifactId}" />
+                    </module-type>
+                    <wb-resource deploy-path="/" source-path="/${relWarPath}" />
+                </j:when>
+                <j:otherwise>
+                    <!-- jar -->
+                    <module-type module-type-id="jst.utility" />
+                </j:otherwise>
+            </j:choose>
+            <j:set var="srcDir" value="" />
+            <!-- main src dir -->
+            <j:if test="${sourcesPresent}">
+                <maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${pom.build.sourceDirectory}" separator="/" />
+                <wb-resource deploy-path="${deployDir}" source-path="/${srcDir}" />
+            </j:if>
+            <!-- resources -->
+            <j:if test="${maven.eclipse.resources.addtoclasspath}">
+                <j:if test="${!pom.build.resources.isEmpty()}">
+                    <j:forEach var="resource" items="${pom.build.resources}">
+                        <maven:makeRelativePath var="resourceDirectory" basedir="${basedir}" path="${resource.directory}" separator="/" />
+                        <!-- don't add duplicate directories -->
+                        <j:if test="${!resourceDirectory.equals(srcDir)}">
+                            <wb-resource deploy-path="${deployDir}" source-path="/${resourceDirectory}" />
+                        </j:if>
+                    </j:forEach>
+                </j:if>
+            </j:if>
+            <!-- generated source directories -->
+            <u:available file="${maven.gen.src}">
+                <u:file var="genSrcRootDir" name="${maven.gen.src}" />
+                <j:forEach var="genSrcDir" items="${genSrcRootDir.listFiles()}">
+                    <maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${genSrcDir}" separator="/" />
+                    <wb-resource deploy-path="${deployDir}" source-path="/${srcDir}" />
+                </j:forEach>
+            </u:available>
+            <j:if test="${moduletype == 'jst.web'}">
+                <j:forEach var="lib" items="${pom.artifacts}">
+                    <j:set var="eclipseDependency" value="${lib.dependency.getProperty('eclipse.dependency')}" />
+                    <j:choose>
+                        <j:when test="${eclipseDependency == 'true'}">
+                            <dependent-module deploy-path="/WEB-INF/lib"
+                                handle="module:/resource/${lib.dependency.artifactId}/${lib.dependency.artifactId}">
+                                <dependency-type>uses</dependency-type>
+                            </dependent-module>
+                        </j:when>
+                        <j:otherwise>
+                            <!-- make sure it's a webapp library -->
+                            <j:if test="${lib.dependency.getProperty('war.bundle')=='true'}">
+                                <maven:makeRelativePath var="relativePath" basedir="${maven.repo.local}" path="${lib.path}" separator="/" />
+                                <u:file var="checkExist" name="${maven.repo.local}/${relativePath}" />
+                                <j:choose>
+                                    <j:when test="${checkExist.exists()}">
+                                        <j:set var="relativePathCheck" value="${relativePath}X" />
+                                        <j:if test='${relativePathCheck == "X"}'>
+                                            <j:set var="relativePath"
+                                                value="${lib.dependency.groupId}/jars/${lib.dependency.artifactId}-${lib.dependency.version}.jar" />
+                                        </j:if>
+                                        <dependent-module deploy-path="/WEB-INF/lib"
+                                            handle="module:/classpath/var/MAVEN_REPO/${relativePath}">
+                                            <dependency-type>uses</dependency-type>
+                                        </dependent-module>
+                                    </j:when>
+                                    <j:otherwise>
+                                        <dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/${lib.path}">
+                                            <dependency-type>uses</dependency-type>
+                                        </dependent-module>
+                                    </j:otherwise>
+                                </j:choose>
+                            </j:if>
+                        </j:otherwise>
+                    </j:choose>
+                </j:forEach>
+            </j:if>
+        </wb-module>
+    </project-modules>
+</j:whitespace>
\ No newline at end of file

Property changes on: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest
___________________________________________________________________
Name: svn:ignore
   + .classpath
.project
.j2ee
.wtpmodules


Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/maven.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/maven.xml	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/maven.xml	(revision 0)
@@ -1 +1,66 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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:j="jelly:core"
+         xmlns:assert="assert"
+         xmlns:u="jelly:util"
+         xmlns:maven="jelly:maven"
+         xmlns:x="jelly:xml">
+
+  <goal name="testPlugin" prereqs="test-duplicatednatures,test-duplicatedbuilders">
+  </goal>
+
+  <goal name="test-init">
+    <j:set var="dotProject" value="${basedir}/.project"/>
+    <j:set var="dotClasspath" value="${basedir}/.classpath"/>
+    <attainGoal name="eclipse:clean"/>
+
+    <attainGoal name="eclipse"/>
+
+    <assert:assertFileExists file="${dotProject}" />
+    <assert:assertFileExists file="${dotClasspath}" />
+  </goal>
+
+  <goal name="test-duplicatednatures" prereqs="test-init">
+
+    <u:file var="projectFile" name="${dotProject}"/>
+    <x:parse var="projectDoc" xml="${projectFile.toURL()}" />
+    <x:set var="natures" select="$projectDoc/projectDescription/natures/nature"/>
+
+    <assert:assertEquals expected="${3}" value="${size(natures)}" msg="Wrong number of natures generated"/>
+
+    <assert:assertEquals expected="org.eclipse.jst.j2ee.web.WebNature" value="${natures[0].text}" msg="Nature 0 is not what expected"/>
+    <assert:assertEquals expected="org.eclipse.jdt.core.javanature" value="${natures[1].text}" msg="Nature 1 is not what expected"/>
+    <assert:assertEquals expected="org.eclipse.wst.common.modulecore.ModuleCoreNature" value="${natures[2].text}" msg="Nature 2 is not what expected"/>
+
+  </goal>
+
+  <goal name="test-duplicatedbuilders" prereqs="test-init">
+
+    <u:file var="projectFile" name="${dotProject}"/>
+    <x:parse var="projectDoc" xml="${projectFile.toURL()}" />
+    <x:set var="builders" select="$projectDoc/projectDescription/buildSpec/buildCommand/name"/>
+
+    <assert:assertEquals expected="${3}" value="${size(builders)}" msg="Wrong number of builders generated"/>
+
+    <assert:assertEquals expected="org.eclipse.wst.common.modulecore.ComponentStructuralBuilder" value="${builders[0].text}" msg="Builder 0 is not what expected"/>
+    <assert:assertEquals expected="org.eclipse.jdt.core.javabuilder" value="${builders[1].text}" msg="Builder 0 is not what expected"/>
+    <assert:assertEquals expected="org.eclipse.jst.j2ee.web.LibDirBuilder" value="${builders[2].text}" msg="Builder 0 is not what expected"/>
+
+  </goal>
+
+</project>
\ No newline at end of file
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.properties
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.properties	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.properties	(revision 0)
@@ -1 +1,3 @@
+maven.eclipse.resources.addtoclasspath=true
+maven.eclipse.projectnatures=org.eclipse.jst.j2ee.web.WebNature,org.eclipse.jdt.core.javanature,org.eclipse.wst.common.modulecore.ModuleCoreNature
+maven.eclipse.buildcommands=org.eclipse.wst.common.modulecore.ComponentStructuralBuilder,org.eclipse.jdt.core.javabuilder,org.eclipse.jst.j2ee.web.LibDirBuilder
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.xml	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/project.xml	(revision 0)
@@ -1 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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>
+  <pomVersion>3</pomVersion>
+  <extend>${basedir}/../project.xml</extend>
+  <id>test-maven-eclipse-duplicatebuilderstest-plugin</id>
+  <name>Test project for Maven Eclipse Plugin (duplicate builders)</name>
+
+  <dependencies>
+    <dependency>
+      <id>maven</id>
+      <version>beta-8</version>
+      <jar>maven.jar</jar>
+    </dependency>
+    <dependency>
+      <groupId>commons-jelly</groupId>
+      <artifactId>commons-jelly-tags-xml</artifactId>
+      <version>20030211.142705</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+    </dependency>
+    <dependency>
+      <groupId>cactus</groupId>
+      <artifactId>cactus</artifactId>
+      <version>13-1.6.1</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+    <unitTest>
+        <includes>
+            <include>**/TestAll.java</include>
+        </includes>
+        <resources>
+            <resource>
+                <directory>src/test-resources</directory>
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main</directory>
+            </resource>
+        </resources>
+    </unitTest>
+    <resources>
+        <resource>
+            <directory>src/main</directory>
+        </resource>
+        <resource>
+            <directory>src/resources</directory>
+            <includes>
+                <include>**/*.properties</include>
+                <include>**/*.xml</include>
+            </includes>
+            <filtering>false</filtering>
+        </resource>
+        <resource>
+            <directory>src/test</directory>
+        </resource>
+    </resources>
+</build>
+</project>
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/src/main/dir.txt
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/src/main/dir.txt	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/duplicatebuilderstest/src/main/dir.txt	(revision 0)
@@ -1 +1 @@
+needed for plugin test
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/maintest/project.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/maintest/project.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/maintest/project.xml	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -21,7 +21,7 @@
 <project>
   <pomVersion>3</pomVersion>
   <extend>${basedir}/../project.xml</extend>
-  <id>test-maven-eclipse-maintest-plugin</id>
+  <id>test-maven-eclipse-maintest-plugin (main)</id>
   <name>Test project for Maven Eclipse Plugin</name>
 
   <dependencies>
@@ -31,7 +31,7 @@
 	  <version>1.0.3</version>
 	  <type>jar</type>
 	  <properties/>
-	</dependency>  
+	</dependency>
     <dependency>
       <id>maven</id>
       <version>beta-8</version>
@@ -46,7 +46,7 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>cactus</groupId>
       <artifactId>cactus</artifactId>
@@ -51,7 +51,7 @@
       <groupId>cactus</groupId>
       <artifactId>cactus</artifactId>
       <version>13-1.6.1</version>
-    </dependency>    
+    </dependency>
   </dependencies>
   <build>
     <sourceDirectory>src/main</sourceDirectory>
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/maven.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/maven.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/maven.xml	(working copy)
@@ -1,13 +1,13 @@
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
  -->
-<project xmlns:j="jelly:core" 
-         xmlns:assert="assert" 
+<project xmlns:j="jelly:core"
+         xmlns:assert="assert"
          xmlns:ant="jelly:ant"
          xmlns:u="jelly:util"
          xmlns:maven="jelly:maven"
@@ -24,7 +24,7 @@
 
   <goal name="testPlugin" prereqs="test-classpath, test-project">
   </goal>
- 
+
    <goal name="test-init">
     <j:set var="dotProject" value="${basedir}/.project"/>
     <j:set var="dotClasspath" value="${basedir}/.classpath"/>
@@ -30,7 +30,7 @@
     <j:set var="dotClasspath" value="${basedir}/.classpath"/>
     <attainGoal name="eclipse:clean"/>
   </goal>
-  
+
   <goal name="test-classpath">
     <attainGoal name="test-init"/>
     <attainGoal name="eclipse"/>
@@ -39,12 +39,12 @@
     </u:available>
     <j:if test="${classpathFound}">
         <ant:fail>The classpath file was created, and shouldn't have been.</ant:fail>
-    </j:if>    
+    </j:if>
 
   </goal>
-  
+
   <goal name="test-project">
-    <attainGoal name="test-init"/>  
+    <attainGoal name="test-init"/>
     <attainGoal name="eclipse:generate-project"/>
 
 	<assert:assertFileExists file="${dotProject}" />
@@ -51,12 +51,13 @@
 
     <u:file var="projectFile" name="${dotProject}"/>
     <x:parse var="projectDoc" xml="${projectFile.toURL()}" />
-    <x:set var="natures" select="$projectDoc/projectDescription/natures/nature"/>
-    <x:set var="countBuilder" select="count($projectDoc/projectDescription/buildSpec/buildCommand/name)"/>    
-    <assert:assertEquals expected="0" value="${countBuilder.intValue().toString()}" msg="Shouldn't find any builders."/> 
-    
-  </goal>  
-    
+    <x:set var="countNatures" select="count($projectDoc/projectDescription/natures/nature)"/>
+    <x:set var="countBuilder" select="count($projectDoc/projectDescription/buildSpec/buildCommand/name)"/>
+    <assert:assertEquals expected="${0}" value="${countBuilder.intValue()}" msg="Shouldn't find any builders."/>
+    <assert:assertEquals expected="${0}" value="${countNatures.intValue()}" msg="Shouldn't find any natures."/>
 
+  </goal>
+
+
 
 </project>
\ No newline at end of file
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/project.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/project.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/nosourcetest/project.xml	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -22,7 +22,7 @@
   <pomVersion>3</pomVersion>
   <extend>${basedir}/../project.xml</extend>
   <id>test-maven-eclipse-nosourcetest-plugin</id>
-  <name>Test project for Maven Eclipse Plugin</name>
+  <name>Test project for Maven Eclipse Plugin (nosource)</name>
 
   <dependencies>
     <dependency>
@@ -39,7 +39,7 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
-    </dependency>      
+    </dependency>
   </dependencies>
   <build>
     <sourceDirectory>src/main</sourceDirectory>

Property changes on: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest
___________________________________________________________________
Name: svn:ignore
   + .project
.classpath


Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/maven.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/maven.xml	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/maven.xml	(revision 0)
@@ -1 +1,59 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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:j="jelly:core"
+         xmlns:assert="assert"
+         xmlns:u="jelly:util"
+         xmlns:maven="jelly:maven"
+         xmlns:x="jelly:xml"
+         xmlns:ant="jelly:ant">
+
+  <goal name="testPlugin" prereqs="test-defaultgoal,test-wtpmodules,test-nowtpmodules">
+  </goal>
+
+  <goal name="test-init">
+    <j:set var="dotWtpmodules" value="${basedir}/.wtpmodules"/>
+    <attainGoal name="eclipse:clean"/>
+  </goal>
+
+  <goal name="test-defaultgoal">
+    <attainGoal name="test-init"/>
+    <attainGoal name="eclipse"/>
+  </goal>
+
+  <goal name="test-nowtpmodules">
+    <attainGoal name="test-init"/>
+    <j:set var="maven.eclipse.projectnatures" value="" />
+    <attainGoal name="eclipse" />
+
+    <u:available file="${dotWtpmodules}">
+        <ant:fail>The .wtpmodules file was created, and shouldn't have been.</ant:fail>
+    </u:available>
+  </goal>
+
+  <goal name="test-wtpmodules">
+    <attainGoal name="test-init"/>
+
+    <attainGoal name="eclipse"/>
+    <assert:assertFileExists file="${dotWtpmodules}" />
+
+    <u:file var="wtpmodulesFile" name="${dotWtpmodules}"/>
+    <x:parse var="wtpmodulesDoc" xml="${wtpmodulesFile.toURL()}" />
+
+  </goal>
+
+</project>
\ No newline at end of file
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.properties
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.properties	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.properties	(revision 0)
@@ -1 +1,6 @@
+maven.eclipse.resources.addtoclasspath=true
+maven.multiproject.type=war
+
+maven.eclipse.projectnatures=org.eclipse.jdt.core.javanature,org.eclipse.wst.common.modulecore.ModuleCoreNature
+maven.eclipse.buildcommands=org.eclipse.wst.common.modulecore.ComponentStructuralBuilder,org.eclipse.jdt.core.javabuilder,org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver
+maven.eclipse.conclasspath=org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5,org.eclipse.jst.j2ee.internal.web.container/wtptest
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.xml	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/project.xml	(revision 0)
@@ -1 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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>
+  <pomVersion>3</pomVersion>
+  <extend>${basedir}/../project.xml</extend>
+  <id>test-maven-eclipse-wtptest-plugin</id>
+  <name>Test project for Maven Eclipse Plugin (wtp)</name>
+
+  <dependencies>
+    <dependency>
+        <groupId>geronimo-spec</groupId>
+        <artifactId>geronimo-spec-servlet</artifactId>
+        <version>2.4-rc4</version>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+    <unitTest>
+        <includes>
+            <include>**/TestAll.java</include>
+        </includes>
+        <resources>
+            <resource>
+                <directory>src/test-resources</directory>
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main</directory>
+            </resource>
+        </resources>
+    </unitTest>
+    <resources>
+        <resource>
+            <directory>src/main</directory>
+        </resource>
+        <resource>
+            <directory>src/resources</directory>
+            <includes>
+                <include>**/*.properties</include>
+                <include>**/*.xml</include>
+            </includes>
+            <filtering>false</filtering>
+        </resource>
+    </resources>
+</build>
+</project>
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/main/dir.txt
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/main/dir.txt	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/main/dir.txt	(revision 0)
@@ -1 +1 @@
+needed for plugin test
\ No newline at end of file
Index: D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/resources/dir.txt
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/resources/dir.txt	(revision 0)
+++ D:/apps/maven-1/plugins/trunk/eclipse/src/plugin-test/wtptest/src/resources/dir.txt	(revision 0)
@@ -1 +1 @@
+needed for plugin test
\ No newline at end of file
Index: D:/apps/maven-1/plugins/trunk/eclipse/xdocs/changes.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/xdocs/changes.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/xdocs/changes.xml	(working copy)
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -30,7 +30,12 @@
       <action dev="epugh" type="fix" issue="MPECLIPSE-67">add-maven-repo fails if Eclipse hasn't been started yet.  Property file needs to be created
       by the plugin.</action>
       <action dev="epugh" type="fix" issue="MPECLIPSE-56" due-to="Archimedes Trajano">Only create .classpath and javabuilder if sources are present</action>
-    </release>    
+      <action type="fix" issue="MPECLIPSE-78" due-to="Fabrizio Giustina">Don't add duplicate java natures/builders if already specified using
+      <code>maven.eclipse.projectnatures</code> and <code>maven.eclipse.buildcommands</code></action>
+      <action type="fix" issue="MPECLIPSE-63" due-to="Fabrizio Giustina">Only add javanature if sources are present</action>
+      <action type="add" issue="MPECLIPSE-80" due-to="Fabrizio Giustina">Generates a .wtpmodules file for eclipse webtools (wtp M4 required)</action>
+      <action type="add" issue="" due-to="Fabrizio Giustina">Adds javadoc paths to .classpath (Eclipse 3.1)</action>
+    </release>
     <release version="1.9" date="2004-10-30">
       <action dev="epugh" type="fix" issue="MPECLIPSE-53">Add property
         <code>maven.eclipse.resources.addtoclasspath</code>to control whether to add pom.resources etc or not. Provide backwards compatiblity.
@@ -78,7 +83,7 @@
     <release version="1.3" date="Unknown">
       <action dev="michal" type="add">Smarter generation of .classpath file. ${basedir} prefix is cut off if present in any path. Default Maven location of source and destination folder are used.</action>
       <action dev="evenisse" type="add">Added dependency functionality between projects</action>
-      <action dev="bwalding" type="update">Split eclispe goal in two goals : eclipse:generate-project and eclipse:generate-classpath</action>
+      <action dev="bwalding" type="update">Split eclipse goal in two goals : eclipse:generate-project and eclipse:generate-classpath</action>
     </release>
     <release version="1.2" date="Unknown">
       <action dev="dion" type="add">Added more documentation</action>
Index: D:/apps/maven-1/plugins/trunk/eclipse/xdocs/goals.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/xdocs/goals.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/xdocs/goals.xml	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -29,19 +29,21 @@
       <goal>
         <name>eclipse</name>
         <description>
-            The default goal. This goal simply executes the 
+            The default goal. This goal simply executes the
             <a href="#eclipse:generate-project">eclipse:generate-project</a> and
             <a href="#eclipse:generate-classpath">eclipse:generate-classpath</a> goals.
+            If the <code>maven.multiproject.type</code> is set to <code>war</code> also calls the
+            <a href="#eclipse:generate-wtpmodules">eclipse:generate-wtpmodules</a> goal.
         </description>
       </goal>
-      
+
       <goal>
         <name>eclipse:clean</name>
         <description>
-          Deletes the <code>.project</code> and <code>.classpath</code> files.
+          Deletes the <code>.project</code>, <code>.classpath</code> and <code>.wtpmodules</code> files.
         </description>
-      </goal>      
-        
+      </goal>
+
       <goal>
         <name>eclipse:generate-project</name>
           <description>
@@ -61,7 +63,7 @@
               <li>the JRE being used</li>
               <li>the appropriate version of JUnit</li>
               <li>each Maven project <code>dependency</code></li>
-              <li>an output directory for compiled code: 
+              <li>an output directory for compiled code:
                 <code>target\classes</code>
               </li>
               <li>any .zip source archives</li>
@@ -68,7 +70,15 @@
             </ol>
           </description>
         </goal>
-        
+
+      <goal>
+        <name>eclipse:generate-wtpmodules</name>
+          <description>
+            Generates a <code>.wtpmodules</code> file for eclipse wtp marking the project as a j2ee module.
+            Project with the <code>maven.multiproject.type</code> set to <code>war</code> are configured as web modules.
+          </description>
+      </goal>
+
         <goal>
           <name>eclipse:external-tools</name>
           <description>
Index: D:/apps/maven-1/plugins/trunk/eclipse/xdocs/properties.xml
===================================================================
--- D:/apps/maven-1/plugins/trunk/eclipse/xdocs/properties.xml	(revision 233308)
+++ D:/apps/maven-1/plugins/trunk/eclipse/xdocs/properties.xml	(working copy)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -38,7 +38,7 @@
             <p>
               On Windows, this will be the <code>workspace</code> directory
               under your eclipse installation. For example, if you installed
-              eclipse into <code>c:\eclipse</code>, the workspace is 
+              eclipse into <code>c:\eclipse</code>, the workspace is
               <code>c:\eclipse\workspace</code>.
             </p>
             <p>
@@ -52,7 +52,7 @@
           <td>Yes (default=3.8.1)</td>
           <td>
             The version of JUnit you want added to your project. If this
-            property is set to <code>none</code> then JUnit will not be added to your 
+            property is set to <code>none</code> then JUnit will not be added to your
             build classpath.
           </td>
         </tr>
@@ -77,7 +77,7 @@
           <td>maven.eclipse.classpath.include</td>
           <td>Yes</td>
           <td>
-            Comma delimited list of additional source directories to include in 
+            Comma delimited list of additional source directories to include in
             the classpath, like <code>src/conf</code>.
           </td>
         </tr>
@@ -88,7 +88,7 @@
             Specify whether to include the resources defined in the POM in the
             Eclipse classpath.  Defaults to false.
           </td>
-        </tr>        
+        </tr>
         <tr>
           <td>maven.eclipse.conclasspath</td>
           <td>Yes</td>
@@ -93,8 +93,8 @@
           <td>maven.eclipse.conclasspath</td>
           <td>Yes</td>
           <td>
-            Comma delimited list of additional kind "con" path 
-            to include in the classpath description file like 
+            Comma delimited list of additional kind "con" path
+            to include in the classpath description file like
             <code>org.eclipse.pde.core.requiredPlugins</code>
           </td>
         </tr>
@@ -102,8 +102,9 @@
           <td>maven.eclipse.buildcommands</td>
           <td>Yes</td>
           <td>
-            Comma delimited list of additional build commands 
-            to include in the project description file.
+            Comma delimited list of additional build commands
+            to include in the project description file. The java builder will automatically be added if a java source
+            dir is set (if not already specified in the list).
           </td>
         </tr>
         <tr>
@@ -112,7 +113,7 @@
           <td>
             Comma delimited list of additional project natures
             to include in the project description file. These natures
-            will be added after the java nature.
+            will be added after the java nature (if the java nature is not already specified in the list).
           </td>
         </tr>
         <tr>
@@ -132,12 +133,22 @@
             The extension used for source attachments.
           </td>
         </tr>
+        <tr>
+          <td>maven.eclipse.runtime</td>
+          <td>No</td>
+          <td>
+            Target runtime for flexible projects. If set a .runtime file is generated.
+            Sample value: <code>Apache Tomcat v5.5</code>
+          </td>
+        </tr>
+
+
       </table>
       <p>
-        Note that you will need to defined a <code>MAVEN_REPO</code> Java 
+        Note that you will need to defined a <code>MAVEN_REPO</code> Java
         Classpath variable in Eclipse. This is done by selecting the Window
         menu, then Preferences. In the dialog box, select the Java node and
-        then Classpath Variables. Create a new variable named 
+        then Classpath Variables. Create a new variable named
         <code>MAVEN_REPO</code> that points to your local Maven repository.
       </p>
     </section>

