You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ah...@apache.org on 2007/11/29 15:43:25 UTC

svn commit: r599461 [1/2] - in /maven/plugins/trunk/maven-eclipse-plugin/src: main/java/org/apache/maven/plugin/eclipse/ main/java/org/apache/maven/plugin/eclipse/writers/ main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/ main/java/org/apach...

Author: aheritier
Date: Thu Nov 29 06:43:17 2007
New Revision: 599461

URL: http://svn.apache.org/viewvc?rev=599461&view=rev
Log:
MECLIPSE-359 : Add support for MyEclipse
Patch reviewed and adapted for new trunk

Added:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.mymetadata
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/DummyClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/resources/dummy
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/DummyTestClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/resources/dummy
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.mymetadata
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/DummyClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/resources/dummy
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/index.jsp   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/test/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/test/java/DummyTestClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/test/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/test/resources/dummy
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/expected/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/expected/.classpath   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/expected/.project   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/expected/.springBeans
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/pom.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/java/DummyClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/applicationContext-bar.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/applicationContext-foo.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/org/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/org/apache/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/org/apache/maven/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/org/apache/maven/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/main/resources/org/apache/maven/test/applicationContext-baz.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/test/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/test/java/DummyTestClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/test/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-03/src/test/resources/dummy
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/expected/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/expected/.classpath   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/expected/.myhibernatedata
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/expected/.project   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/expected/.springBeans
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/pom.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/java/DummyClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/org/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/org/apache/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/org/apache/maven/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/org/apache/maven/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/main/resources/org/apache/maven/test/applicationContext-persistence.xml   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/test/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/test/java/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/test/java/DummyTestClass.txt   (with props)
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/test/resources/
    maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-04/src/test/resources/dummy
Modified:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java
    maven/plugins/trunk/maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=599461&r1=599460&r2=599461&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Thu Nov 29 06:43:17 2007
@@ -81,7 +81,7 @@
     private static final String BUILDER_WST_COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER =
         "org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver"; //$NON-NLS-1$
 
-    private static final String BUILDER_WST_VALIDATION = "org.eclipse.wst.validation.validationbuilder"; //$NON-NLS-1$
+    protected static final String BUILDER_WST_VALIDATION = "org.eclipse.wst.validation.validationbuilder"; //$NON-NLS-1$
 
     private static final String BUILDER_JDT_CORE_JAVA = "org.eclipse.jdt.core.javabuilder"; //$NON-NLS-1$
 

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,29 @@
+package org.apache.maven.plugin.eclipse;
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Deletes configuration files used by MyEclipse
+ * 
+ * @author Olivier Jacob
+ * @goal myeclipse-clean
+ * @since 2.5
+ * @phase
+ */
+public class MyEclipseCleanMojo
+    extends EclipseCleanMojo
+{
+    /**
+     * @throws MojoExecutionException
+     */
+    protected void cleanExtras()
+        throws MojoExecutionException
+    {
+        delete( new File( getBasedir(), ".mymetadata" ) );
+        delete( new File( getBasedir(), ".mystrutsdata" ) );
+        delete( new File( getBasedir(), ".myhibernatedata" ) );
+        delete( new File( getBasedir(), ".springBeans" ) );
+    }
+}

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipseCleanMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,330 @@
+package org.apache.maven.plugin.eclipse;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.writers.EclipseProjectWriter;
+import org.apache.maven.plugin.eclipse.writers.EclipseSettingsWriter;
+import org.apache.maven.plugin.eclipse.writers.EclipseWriterConfig;
+import org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseClasspathWriter;
+import org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseHibernateWriter;
+import org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseMetadataWriter;
+import org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseSpringBeansWriter;
+import org.apache.maven.plugin.eclipse.writers.myeclipse.MyEclipseStrutsDataWriter;
+import org.apache.maven.plugin.ide.IdeDependency;
+import org.apache.maven.plugin.ide.IdeUtils;
+import org.apache.maven.plugin.ide.JeeUtils;
+
+/**
+ * Generates MyEclipse configuration files
+ * 
+ * @author <a href="mailto:olivier.jacob@gmail.com">Olivier Jacob</a>
+ * @goal myeclipse
+ * @since 2.5
+ * @execute phase="generate-resources"
+ */
+public class MyEclipsePlugin
+    extends EclipsePlugin
+{
+    /* MyEclipse project natures */
+    private static final String MYECLIPSE_EAR_NATURE = "com.genuitec.eclipse.j2eedt.core.earnature";
+
+    private static final String MYECLIPSE_WEB_NATURE = "com.genuitec.eclipse.j2eedt.core.webnature";
+
+    private static final String MYECLISPE_SPRING_NATURE = "com.genuitec.eclipse.springframework.springnature";
+
+    private static final String MYECLIPSE_STRUTS_NATURE =
+        "com.genuitec.eclipse.cross.easystruts.eclipse.easystrutsnature";
+
+    private static final String MYECLIPSE_HIBERNATE_NATURE = "com.genuitec.eclipse.hibernate.hibernatenature";
+
+    /* MyEclipse builders */
+    private static final String MYECLIPSE_DEPLOYMENT_DESCRIPTOR_VALIDATOR_BUILDER =
+        "com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator";
+
+    private static final String MYECLIPSE_WEB_CLASSPATH_BUILDER =
+        "com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder";
+
+    private static final String MYECLIPSE_J2EE_PROJECT_VALIDATOR_BUILDER =
+        "com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator";
+
+    private static final String MYECLIPSE_SPRING_BUILDER = "com.genuitec.eclipse.springframework.springbuilder";
+
+    private static final String MYECLIPSE_HIBERNATE_BUILDER = "com.genuitec.eclipse.hibernate.HibernateBuilder";
+
+    private static final String MYECLIPSE_J2EE_14_CLASSPATH_CONTAINER =
+        "com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER";
+
+    private static final String MYECLIPSE_J2EE_13_CLASSPATH_CONTAINER =
+        "com.genuitec.eclipse.j2eedt.core.J2EE13_CONTAINER";
+
+    private static final String MYECLIPSE_DEFAULT_HIBERNATE_CFG_XML = "src/main/resources/applicationContext.xml";
+
+    /**
+     * Spring configuration placeholder <p/>
+     * 
+     * <pre>
+     *   &lt;spring&gt;
+     *     &lt;version&gt;1.0/2.0&lt;/version&gt;
+     *     &lt;file-pattern&gt;applicationContext-*.xml&lt;/file-pattern&gt;
+     *     &lt;basedir&gt;src/main/resources&lt;/basedir&gt;
+     *   &lt;/spring&gt;
+     * </pre>
+     * 
+     * @parameter
+     */
+    private Map spring;
+
+    /**
+     * Hibernate configuration placeholder <p/>
+     * 
+     * <pre>
+     *   &lt;hibernate&gt;
+     *     &lt;config-file&gt;src/main/resources/applicationContext-persistence.xml&lt;/config-file&gt;
+     *     &lt;session-factory-id&gt;mySessionFactory&lt;/session-factory-id&gt;
+     *   &lt;/hibernate&gt;
+     * </pre>
+     * 
+     * @parameter
+     */
+    private Map hibernate;
+
+    /**
+     * Allow declaration of struts properties for MyEclipse <p/>
+     * 
+     * <pre>
+     *   &lt;struts&gt;
+     *     &lt;version&gt;1.2.9&lt;/version&gt;
+     *     &lt;servlet-name&gt;action&lt;/servlet-name&gt;
+     *     &lt;pattern&gt;*.do&lt;/pattern&gt;
+     *     &lt;base-package&gt;1.2.9&lt;/base-package&gt;
+     *   &lt;/struts&gt;
+     * </pre>
+     * 
+     * @parameter
+     */
+    private Map struts;
+
+    public void writeConfiguration( IdeDependency[] deps )
+        throws MojoExecutionException
+    {
+        EclipseWriterConfig config = createEclipseWriterConfig( deps );
+
+        new EclipseSettingsWriter().init( getLog(), config ).write();
+
+        if ( isJavaProject() )
+        {
+            // If the project is a Web Project, make it compile in WEB-INF/classes
+            if ( Constants.PROJECT_PACKAGING_WAR.equals( project.getPackaging() ) )
+            {
+                String warSourceDirectory =
+                    IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN,
+                                               "warSourceDirectory",//$NON-NLS-1$
+                                               "/src/main/webapp" ); //$NON-NLS-1$
+
+                EclipseSourceDir[] sourceDirs = config.getSourceDirs();
+                for ( int i = 0; i < sourceDirs.length; i++ )
+                {
+                    if ( !sourceDirs[i].isTest() )
+                    {
+                        sourceDirs[i].setOutput( warSourceDirectory + "/WEB-INF/classes" );
+                    }
+                }
+            }
+
+            new MyEclipseClasspathWriter().init( getLog(), config ).write();
+        }
+
+        new EclipseProjectWriter().init( getLog(), config ).write();
+
+        // the MyEclipse part ...
+
+        new MyEclipseMetadataWriter().init( getLog(), config ).write();
+
+        if ( getStruts() != null )
+        {
+            new MyEclipseStrutsDataWriter( getStruts() ).init( getLog(), config ).write();
+        }
+        if ( getSpring() != null )
+        {
+            new MyEclipseSpringBeansWriter( getSpring() ).init( getLog(), config ).write();
+        }
+        if ( getHibernate() != null )
+        {
+            // Only Spring configuration file is currently supported
+            String hbmCfgFile = (String) getHibernate().get( "config-file" );
+
+            if ( "".equals( hbmCfgFile ) )
+            {
+                hbmCfgFile = MYECLIPSE_DEFAULT_HIBERNATE_CFG_XML;
+            }
+
+            new MyEclipseHibernateWriter( getHibernate() ).init( getLog(), config ).write();
+        }
+    }
+
+    /**
+     * Override the default builders with the builders used by MyEclipse
+     * 
+     * @param packaging packaging-type (jar,war,ejb,ear)
+     */
+    protected void fillDefaultBuilders( String packaging )
+    {
+        List commands = new ArrayList();
+
+        super.fillDefaultBuilders( packaging );
+
+        if ( Constants.PROJECT_PACKAGING_EAR.equals( packaging ) )
+        {
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().debug( "EAR packaging does not need specific builders" );
+            }
+        }
+        else if ( Constants.PROJECT_PACKAGING_WAR.equals( packaging ) )
+        {
+            commands.add( MYECLIPSE_DEPLOYMENT_DESCRIPTOR_VALIDATOR_BUILDER );
+            commands.add( MYECLIPSE_J2EE_PROJECT_VALIDATOR_BUILDER );
+            commands.add( MYECLIPSE_WEB_CLASSPATH_BUILDER );
+
+            // WST Validation Builder : may be added by super.fillDefaultBuilders so check before adding it
+            if ( !getBuildcommands().contains( new BuildCommand( BUILDER_WST_VALIDATION ) ) )
+            {
+                commands.add( BUILDER_WST_VALIDATION );
+            }
+        }
+        else if ( Constants.PROJECT_PACKAGING_EJB.equals( packaging ) )
+        {
+            if ( getLog().isInfoEnabled() )
+            {
+                getLog().info( "EJB packaging is not implemented yet" );
+            }
+        }
+        else if ( isJavaProject() )
+        {
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().debug( "JAR packaging does not need specific builders" );
+            }
+        }
+
+        if ( getSpring() != null )
+        {
+            commands.add( MYECLIPSE_SPRING_BUILDER );
+        }
+        if ( getHibernate() != null )
+        {
+            commands.add( MYECLIPSE_HIBERNATE_BUILDER );
+        }
+
+        convertBuildCommandList( commands );
+        getBuildcommands().addAll( commands );
+    }
+
+    /**
+     * Override the default natures with the natures used by MyEclipse
+     * 
+     * @param packaging packaging-type (jar,war,ejb,ear)
+     */
+    protected void fillDefaultNatures( String packaging )
+    {
+        List natures = new ArrayList();
+
+        super.fillDefaultNatures( packaging );
+
+        if ( Constants.PROJECT_PACKAGING_EAR.equals( packaging ) )
+        {
+            natures.add( MYECLIPSE_EAR_NATURE );
+        }
+        else if ( Constants.PROJECT_PACKAGING_WAR.equals( packaging ) )
+        {
+            natures.add( MYECLIPSE_WEB_NATURE );
+        }
+        else if ( Constants.PROJECT_PACKAGING_EJB.equals( packaging ) )
+        {
+            if ( getLog().isInfoEnabled() )
+            {
+                getLog().info( "EJB packaging is not implemented yet" );
+            }
+        }
+        else if ( isJavaProject() )
+        {
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().debug( "JAR projects does not need specific natures" );
+            }
+        }
+
+        // Spring
+        if ( getSpring() != null )
+        {
+            natures.add( MYECLISPE_SPRING_NATURE );
+        }
+        // Struts
+        if ( getStruts() != null )
+        {
+            natures.add( MYECLIPSE_STRUTS_NATURE );
+        }
+
+        // Hibernate
+        if ( getHibernate() != null )
+        {
+            natures.add( MYECLIPSE_HIBERNATE_NATURE );
+        }
+
+        getProjectnatures().addAll( natures );
+    }
+
+    protected void fillDefaultClasspathContainers( String packaging )
+    {
+        super.fillDefaultClasspathContainers( packaging );
+
+        if ( Constants.PROJECT_PACKAGING_WAR.equals( packaging ) )
+        {
+            String jeeVersion =
+                JeeUtils.getJeeDescriptorFromServletVersion( JeeUtils.resolveServletVersion( project ) ).getJeeVersion();
+
+            if ( "1.3".equals( jeeVersion ) )
+            {
+                getClasspathContainers().add( MYECLIPSE_J2EE_13_CLASSPATH_CONTAINER );
+            }
+            else if ( "1.4".equals( jeeVersion ) )
+            {
+                getClasspathContainers().add( MYECLIPSE_J2EE_14_CLASSPATH_CONTAINER );
+            }
+        }
+    }
+
+    public Map getSpring()
+    {
+        return spring;
+    }
+
+    public void setSpring( Map spring )
+    {
+        this.spring = spring;
+    }
+
+    public Map getHibernate()
+    {
+        return hibernate;
+    }
+
+    public void setHibernate( Map hibernate )
+    {
+        this.hibernate = hibernate;
+    }
+
+    public Map getStruts()
+    {
+        return struts;
+    }
+
+    public void setStruts( Map struts )
+    {
+        this.struts = struts;
+    }
+
+}

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/MyEclipsePlugin.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java?rev=599461&r1=599460&r2=599461&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java Thu Nov 29 06:43:17 2007
@@ -363,7 +363,7 @@
 
     }
 
-    private void addDependency( XMLWriter writer, IdeDependency dep )
+    protected void addDependency( XMLWriter writer, IdeDependency dep )
         throws MojoExecutionException
     {
 

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,35 @@
+package org.apache.maven.plugin.eclipse.writers.myeclipse;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.writers.EclipseClasspathWriter;
+import org.apache.maven.plugin.ide.IdeDependency;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+/**
+ * @author <a href="mailto:olivier.jacob@gmail.com">Olivier Jacob</a>
+ */
+public class MyEclipseClasspathWriter
+    extends EclipseClasspathWriter
+{
+    /**
+     * Write the dependency only if scope is <b>not</b> provided
+     * 
+     * @param writer the XmlWriter to write the config with
+     * @param dep the dependency to be added to configuration
+     * @throws MojoExecutionException
+     */
+    protected void addDependency( XMLWriter writer, IdeDependency dep )
+        throws MojoExecutionException
+    {
+
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "Currently processing " + dep.getArtifactId() + " dependency" );
+        }
+
+        if ( !dep.isProvided() )
+        {
+            super.addDependency( writer, dep );
+        }
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseClasspathWriter.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,178 @@
+package org.apache.maven.plugin.eclipse.writers.myeclipse;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.Messages;
+import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
+import org.apache.maven.plugin.ide.IdeUtils;
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * Writer for MyEclipse Hibernate Capability
+ * 
+ * @author <a href="mailto:olivier.jacob@gmail.com">Olivier Jacob</a>
+ */
+public class MyEclipseHibernateWriter
+    extends AbstractEclipseWriter
+{
+
+    private static final String MYECLIPSE_HIBERNATE_DATA_FILE = ".myhibernatedata";
+
+    private static final String MYECLIPSE_HB_GEN_COMP_ID = "genBasicCompId";
+
+    private static final String MYECLIPSE_HB_SESSION_FACTORY_NAME = "sessionFactoryName";
+
+    private static final String MYECLIPSE_HB_PROFILE = "profile";
+
+    private static final String MYECLIPSE_HB_DAO_SF_ID = "daoSFId";
+
+    private static final String MYECLIPSE_HB_VERSION = "version";
+
+    private static final String MYECLIPSE_HB_JNDI_PATH = "jndiPath";
+
+    private static final String MYECLIPSE_HB_DETECT_M2M = "detectM2M";
+
+    private static final String MYECLIPSE_HB_RE_STRATEGY_CLASS = "reStrategyClass";
+
+    private static final String MYECLIPSE_HB_SPRING_DAO_FILE = "springDaoFile";
+
+    private static final String MYECLIPSE_HB_USE_JAVA_TYPES = "useJavaTypes";
+
+    private static final String MYECLIPSE_HB_KEY_GENERATOR = "keyGenerator";
+
+    private static final String MYECLIPSE_HB_LIB_INSTALL_FOLDER = "libInstallFolder";
+
+    private static final String MYECLIPSE_HB_ADD_LIBS_TO_PROJECT = "addLibs2Project";
+
+    private static final String MYECLIPSE_HB_GEN_VERSION_TAG = "genVersionTag";
+
+    private static final String MYECLIPSE_HB_SESSION_FACTORY_ID = "sessionFactoryId";
+
+    private static final String MYECLIPSE_HB_BASE_PERSISTENT_CLASS = "basePersistenceClass";
+
+    private static final String MYECLIPSE_HB_RE_SETTINGS_FILE = "reSettingsFile";
+
+    private static final String MYECLIPSE_HB_CONFIG_FILE = "configFile";
+
+    private static final String MYECLIPSE_HB_CREATE_CONFIG_FILE = "createConfigFile";
+
+    private static final String MYECLIPSE_HB_ADD_LIBS_TO_CLASSPATH = "addLibs2Classpath";
+
+    private static final String MYECLIPSE_HB_BASE_DAO_CLASS = "baseDaoClass";
+
+    /**
+     * Relative path to the Hibernate configuration file to use in MyEclipse
+     */
+    private Map hibernateConfig;
+
+    /**
+     * Constructor
+     * 
+     * @param hibernateConfig path to the configuration file to use
+     */
+    public MyEclipseHibernateWriter( Map hibernateConfig )
+    {
+        this.hibernateConfig = hibernateConfig;
+    }
+
+    /**
+     * Write MyEclipse Hibernate configuration
+     * 
+     * @throws MojoExecutionException if an error occurs
+     */
+    public void write()
+        throws MojoExecutionException
+    {
+        FileWriter w;
+
+        try
+        {
+            w = new FileWriter( new File( config.getEclipseProjectDirectory(), MYECLIPSE_HIBERNATE_DATA_FILE ) );
+        }
+        catch ( IOException ex )
+        {
+            throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
+        }
+
+        PrintWriter pw = new PrintWriter( w );
+
+        pw.println( "# Generated by Maven" );
+        addProperty( pw, MYECLIPSE_HB_GEN_COMP_ID, "false" );
+        addProperty( pw, MYECLIPSE_HB_SESSION_FACTORY_NAME, null );
+        addProperty( pw, MYECLIPSE_HB_PROFILE, null );
+        addProperty( pw, MYECLIPSE_HB_DAO_SF_ID, null );
+        addProperty( pw, MYECLIPSE_HB_VERSION, getHibernateVersion() );
+        addProperty( pw, MYECLIPSE_HB_JNDI_PATH, null );
+        addProperty( pw, MYECLIPSE_HB_DETECT_M2M, "false" );
+        addProperty( pw, MYECLIPSE_HB_RE_STRATEGY_CLASS, null );
+        addProperty( pw, MYECLIPSE_HB_SPRING_DAO_FILE, null );
+        addProperty( pw, MYECLIPSE_HB_USE_JAVA_TYPES, "true" );
+        addProperty( pw, MYECLIPSE_HB_KEY_GENERATOR, null );
+        addProperty( pw, MYECLIPSE_HB_LIB_INSTALL_FOLDER, null );
+        addProperty( pw, MYECLIPSE_HB_ADD_LIBS_TO_PROJECT, "false" );
+        addProperty( pw, MYECLIPSE_HB_GEN_VERSION_TAG, "false" );
+        addProperty( pw, MYECLIPSE_HB_SESSION_FACTORY_ID, (String) hibernateConfig.get( "session-factory-id" ) );
+        addProperty( pw, MYECLIPSE_HB_BASE_PERSISTENT_CLASS, null );
+        addProperty( pw, MYECLIPSE_HB_RE_SETTINGS_FILE, null );
+        addProperty( pw, MYECLIPSE_HB_CONFIG_FILE,
+                     makePathToHibernateConfigFile( (String) hibernateConfig.get( "config-file" ) ) );
+        addProperty( pw, MYECLIPSE_HB_CREATE_CONFIG_FILE, "false" );
+        addProperty( pw, MYECLIPSE_HB_ADD_LIBS_TO_CLASSPATH, "false" );
+        addProperty( pw, MYECLIPSE_HB_BASE_DAO_CLASS, null );
+
+        IOUtil.close( w );
+    }
+
+    /**
+     * Writes a configuration property to the PrintWriter given in parameter
+     * 
+     * @param pw the PrintWriter to write to
+     * @param propName the property name
+     * @param propValue the property value (writes empty String if null)
+     */
+    private void addProperty( PrintWriter pw, String propName, String propValue )
+    {
+        StringBuffer sb = new StringBuffer( 64 );
+
+        sb.append( propName ).append( "=" );
+
+        if ( propValue != null )
+        {
+            sb.append( propValue );
+        }
+
+        pw.println( sb.toString() );
+    }
+
+    /**
+     * Find Hibernate version in project dependencies
+     * 
+     * @return the version of the hibernate artifact if found in the dependencies or 3.2 (default value)
+     */
+    private String getHibernateVersion()
+    {
+        String version =
+            IdeUtils.getArtifactVersion( new String[] { "hibernate" }, config.getProject().getDependencies(), 3 );
+
+        return version != null ? version : "3.2";
+    }
+
+    /**
+     * Prepend the project artifactId to the path given in the plugin configuration
+     * 
+     * @return the path to the file relative to the root of the Eclipse Workspace
+     */
+    private String makePathToHibernateConfigFile( String configFile )
+    {
+        StringBuffer sb = new StringBuffer( 64 );
+
+        sb.append( "/" ).append( config.getProject().getArtifactId() ).append( "/" ).append( configFile );
+
+        return sb.toString();
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,167 @@
+package org.apache.maven.plugin.eclipse.writers.myeclipse;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.Constants;
+import org.apache.maven.plugin.eclipse.Messages;
+import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
+import org.apache.maven.plugin.ide.IdeUtils;
+import org.apache.maven.plugin.ide.JeeDescriptor;
+import org.apache.maven.plugin.ide.JeeUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+/**
+ * MyEclipse .mymetadata configuration file writer
+ * 
+ * @author Olivier Jacob
+ */
+public class MyEclipseMetadataWriter
+    extends AbstractEclipseWriter
+{
+
+    private static final String MYECLIPSE_MYMETADATA_FILENAME = ".mymetadata";
+
+    private static final String MYECLIPSE_METADATA_PROJECT = "project-module";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_TYPE = "type";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_NAME = "name";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_ID = "id";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_CONTEXT_ROOT = "context-root";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_J2EE_SPEC = "j2ee-spec";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_ARCHIVE = "archive";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_TYPE_WAR = "WEB";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_TYPE_EAR = "EAR";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_TYPE_EJB = "EJB";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_ATTRIBUTES = "attributes";
+
+    private static final String MYECLIPSE_METADATA_PROJECT_ATTRIBUTE = "attribute";
+
+    /**
+     * Writer entry point
+     * 
+     * @throws MojoExecutionException
+     */
+    public void write()
+        throws MojoExecutionException
+    {
+        String packaging = config.getProject().getPackaging();
+
+        if ( !Constants.PROJECT_PACKAGING_EAR.equalsIgnoreCase( packaging ) &&
+            !Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging ) &&
+            !Constants.PROJECT_PACKAGING_EJB.equalsIgnoreCase( packaging ) )
+        {
+            return;
+        }
+
+        FileWriter w;
+
+        try
+        {
+            w = new FileWriter( new File( config.getEclipseProjectDirectory(), MYECLIPSE_MYMETADATA_FILENAME ) );
+        }
+        catch ( IOException ex )
+        {
+            throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
+        }
+
+        XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null );
+
+        writer.startElement( MYECLIPSE_METADATA_PROJECT );
+        writer.addAttribute( MYECLIPSE_METADATA_PROJECT_TYPE, getMyEclipseProjectType( packaging ) );
+        writer.addAttribute( MYECLIPSE_METADATA_PROJECT_NAME, config.getEclipseProjectName() );
+        writer.addAttribute( MYECLIPSE_METADATA_PROJECT_ID, config.getEclipseProjectName() );
+
+        if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging ) )
+        {
+            // Find web application context root from maven-war-plugin configuration.
+            // ArtifactId is used as the default value
+            String warContextRoot =
+                IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN, "warContextRoot",//$NON-NLS-1$
+                                           "/" + config.getProject().getArtifactId() );
+
+            writer.addAttribute( MYECLIPSE_METADATA_PROJECT_CONTEXT_ROOT, warContextRoot );
+
+            writer.addAttribute( MYECLIPSE_METADATA_PROJECT_J2EE_SPEC, getJeeVersion() );
+            // TODO : use maven final name
+            writer.addAttribute( MYECLIPSE_METADATA_PROJECT_ARCHIVE, config.getEclipseProjectName() + ".war" );
+        }
+
+        if ( Constants.PROJECT_PACKAGING_EAR.equalsIgnoreCase( packaging ) )
+        {
+            // TODO : use maven final name
+            writer.addAttribute( MYECLIPSE_METADATA_PROJECT_ARCHIVE, config.getEclipseProjectName() + ".ear" );
+        }
+
+        writer.startElement( MYECLIPSE_METADATA_PROJECT_ATTRIBUTES );
+        if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging ) )
+        {
+            writer.startElement( MYECLIPSE_METADATA_PROJECT_ATTRIBUTE );
+            writer.addAttribute( "name", "webrootdir" );
+            // TODO : retrieve this from project configuration
+            writer.addAttribute( "value", "src/main/webapp" );
+            writer.endElement();
+        }
+        // Close <attributes>
+        writer.endElement();
+
+        // Close <project-module>
+        writer.endElement();
+
+        IOUtil.close( w );
+    }
+
+    /**
+     * @param packaging maven project packaging
+     * @return MyEclipse project type (EAR, WAR, EJB)
+     */
+    private String getMyEclipseProjectType( String packaging )
+    {
+        if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging ) )
+        {
+            return MYECLIPSE_METADATA_PROJECT_TYPE_WAR;
+        }
+        if ( Constants.PROJECT_PACKAGING_EAR.equalsIgnoreCase( packaging ) )
+        {
+            return MYECLIPSE_METADATA_PROJECT_TYPE_EAR;
+        }
+        if ( Constants.PROJECT_PACKAGING_EJB.equalsIgnoreCase( packaging ) )
+        {
+            return MYECLIPSE_METADATA_PROJECT_TYPE_EJB;
+        }
+        // Should never be reached
+        return null;
+    }
+
+    /**
+     * Find JEE version from the project dependencies : find version from 'j2ee.jar' artifact or from 'servlet-api'
+     * 
+     * @return the JEE version for the project (1.2, 1.3, 1.4, 1.5)
+     * @see org.apache.maven.plugin.ide.JeeUtils#resolveJeeVersion(org.apache.maven.project.MavenProject)
+     */
+    private String getJeeVersion()
+    {
+        String jeeVersion =
+            JeeUtils.getJeeDescriptorFromServletVersion( JeeUtils.resolveServletVersion( config.getProject() ) ).getJeeVersion();
+
+        if ( jeeVersion == null )
+        {
+            return JeeDescriptor.JEE_1_4;
+        }
+
+        return jeeVersion;
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,155 @@
+package org.apache.maven.plugin.eclipse.writers.myeclipse;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.Messages;
+import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+/**
+ * MyEclipse .springBeans configuration file writer
+ * 
+ * @author Olivier Jacob
+ */
+public class MyEclipseSpringBeansWriter
+    extends AbstractEclipseWriter
+{
+    private static final String MYECLIPSE_SPRING_CONFIGURATION_FILENAME = ".springBeans";
+
+    private static final String MYECLIPSE_SPRING_BEANS_PROJECT_DESCRIPTION = "beansProjectDescription";
+
+    private static final String MYECLIPSE_SPRING_CONFIG_EXTENSIONS = "configExtensions";
+
+    private static final String MYECLIPSE_SPRING_CONFIG_EXTENSION = "configExtension";
+
+    private static final String MYECLIPSE_SPRING_CONFIGS = "configs";
+
+    private static final String MYECLIPSE_SPRING_CONFIG = "config";
+
+    private static final String MYECLIPSE_SPRING_CONFIGSETS = "configSets";
+
+    private static final String MYECLIPSE_SPRING_VERSION = "springVersion";
+
+    /**
+     * Spring configuration filenames (injected by the plugin)
+     */
+    private Map springConfig;
+
+    /**
+     * Allow injection of Spring configuration filenames through constructor
+     * 
+     * @param springConfig a map holding Spring configuration properties
+     */
+    public MyEclipseSpringBeansWriter( Map springConfig )
+    {
+        this.springConfig = springConfig;
+    }
+
+    /**
+     * Write MyEclipse .springBeans configuration file
+     * 
+     * @throws MojoExecutionException
+     */
+    public void write()
+        throws MojoExecutionException
+    {
+        FileWriter w;
+        try
+        {
+            w =
+                new FileWriter( new File( config.getEclipseProjectDirectory(), MYECLIPSE_SPRING_CONFIGURATION_FILENAME ) );
+        }
+        catch ( IOException ex )
+        {
+            throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
+        }
+
+        XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null );
+
+        writer.startElement( MYECLIPSE_SPRING_BEANS_PROJECT_DESCRIPTION );
+        // Configuration extension
+        writer.startElement( MYECLIPSE_SPRING_CONFIG_EXTENSIONS );
+        writer.startElement( MYECLIPSE_SPRING_CONFIG_EXTENSION );
+        writer.writeText( "xml" );
+        writer.endElement();
+        writer.endElement();
+
+        // Configuration files
+        writer.startElement( MYECLIPSE_SPRING_CONFIGS );
+
+        Iterator onConfigFiles =
+            getConfigurationFilesList( (String) springConfig.get( "basedir" ),
+                                       (String) springConfig.get( "file-pattern" ) ).iterator();
+        while ( onConfigFiles.hasNext() )
+        {
+            writer.startElement( MYECLIPSE_SPRING_CONFIG );
+            writer.writeText( StringUtils.replace( (String) onConfigFiles.next(), "\\", "/" ) );
+            writer.endElement();
+        }
+        writer.endElement();
+
+        // Configuration sets
+        writer.startElement( MYECLIPSE_SPRING_CONFIGSETS );
+        writer.endElement();
+
+        // Spring version
+        writer.startElement( MYECLIPSE_SPRING_VERSION );
+        writer.writeText( (String) springConfig.get( "version" ) );
+        writer.endElement();
+
+        writer.endElement();
+
+        IOUtil.close( w );
+    }
+
+    /**
+     * Retrieve the list of Spring configuration files recursively from the <code>basedir</code> directory,
+     * considering only filenames matching the <code>pattern</code> given
+     * 
+     * @param basedir the path to the base directory to search in
+     * @param pattern file include pattern
+     * @return the list of filenames matching the given pattern
+     */
+    private Collection getConfigurationFilesList( String basedir, String pattern )
+    {
+        Collection configFiles = new ArrayList();
+
+        try
+        {
+            File directory = new File( basedir );
+
+            File[] subdirs = directory.listFiles( new FileFilter()
+            {
+                public boolean accept( File pathname )
+                {
+                    return pathname.isDirectory();
+                }
+            } );
+
+            for ( int i = 0; i < subdirs.length; i++ )
+            {
+                configFiles.addAll( getConfigurationFilesList( subdirs[i].getPath(), pattern ) );
+            }
+
+            configFiles.addAll( FileUtils.getFileNames( directory, pattern, null, true ) );
+        }
+        catch ( IOException ioe )
+        {
+            log.error( "Error while retrieving Spring configuration files. Returning list in current state" );
+        }
+
+        return configFiles;
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,189 @@
+package org.apache.maven.plugin.eclipse.writers.myeclipse;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.Constants;
+import org.apache.maven.plugin.eclipse.Messages;
+import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
+import org.apache.maven.plugin.ide.IdeUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+/**
+ * MyEclipse .mystrutsdata configuration file writer
+ * 
+ * @author Olivier Jacob
+ */
+public class MyEclipseStrutsDataWriter
+    extends AbstractEclipseWriter
+{
+    private static final String MYECLIPSE_MYSTRUTSDATA_FILENAME = ".mystrutsdata";
+
+    private static final String MYECLIPSE_STRUTS_PROPERTIES = "MyEclipseStrutsProperties";
+
+    private static final String MYECLIPSE_STRUTS_VERSION = "strutsVersion";
+
+    private static final String MYECLIPSE_STRUTS_BASE_PACKAGE = "basePackage";
+
+    private static final String MYECLIPSE_STRUTS_PATTERN = "strutsPattern";
+
+    private static final String MYECLIPSE_STRUTS_SERVLET_NAME = "servletName";
+
+    private static final String MYECLIPSE_STRUTS_DEFAULT_PATTERN = "*.do";
+
+    private static final String MYECLIPSE_STRUTS_SERVLET_DEFAULT_NAME = "action";
+
+    private static Map strutsPatterns;
+
+    private Map strutsProps;
+
+    /**
+     * Receive struts properties map from plugin
+     * 
+     * @param strutsProps
+     * @see org.apache.maven.plugin.eclipse.MyEclipsePlugin#struts
+     */
+    public MyEclipseStrutsDataWriter( Map strutsProps )
+    {
+        this.strutsProps = strutsProps;
+
+        strutsPatterns = new HashMap();
+        strutsPatterns.put( "*.do", "0" );
+        strutsPatterns.put( "/do/*", "1" );
+    }
+
+    /**
+     * Write MyEclipse .mystrutsdata configuration file
+     * 
+     * @throws MojoExecutionException
+     */
+    public void write()
+        throws MojoExecutionException
+    {
+        String packaging = config.getProject().getPackaging();
+
+        if ( Constants.PROJECT_PACKAGING_WAR.equals( packaging ) )
+        {
+            FileWriter w;
+            try
+            {
+                w = new FileWriter( new File( config.getEclipseProjectDirectory(), MYECLIPSE_MYSTRUTSDATA_FILENAME ) );
+            }
+            catch ( IOException ex )
+            {
+                throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
+            }
+
+            XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null );
+
+            writer.startElement( MYECLIPSE_STRUTS_PROPERTIES );
+
+            writer.startElement( MYECLIPSE_STRUTS_VERSION );
+            writer.writeText( getStrutsVersion() );
+            writer.endElement();
+
+            writer.startElement( MYECLIPSE_STRUTS_BASE_PACKAGE );
+            writer.writeText( getBasePackage() );
+            writer.endElement();
+
+            writer.startElement( MYECLIPSE_STRUTS_PATTERN );
+            writer.writeText( getStrutsPattern() );
+            writer.endElement();
+
+            writer.startElement( MYECLIPSE_STRUTS_SERVLET_NAME );
+            writer.writeText( getStrutsServletName() );
+            writer.endElement();
+
+            // Close <MyEclipseStrutsProperties>
+            writer.endElement();
+
+            IOUtil.close( w );
+        }
+    }
+
+    /**
+     * Retrieve Struts version from plugin configuration or if not specified from project dependencies. If none is
+     * specified, use 1.2.9 as default
+     * 
+     * @return my eclipse struts version code
+     */
+    private String getStrutsVersion()
+    {
+        String version;
+
+        if ( strutsProps != null && strutsProps.get( "version" ) != null )
+        {
+            version = (String) strutsProps.get( "version" );
+        }
+        else
+        {
+            version =
+                IdeUtils.getArtifactVersion( new String[] { "struts", "struts-core" },
+                                             config.getProject().getDependencies(), 5 );
+
+            // Newest version supported by MyEclipse is Struts 1.2.x
+            if ( version == null )
+            {
+                version = "1.2.9";
+            }
+        }
+
+        int firstDotIndex = version.indexOf( '.' );
+        int secondDotIndex = version.indexOf( '.', firstDotIndex + 1 );
+        String majorVersion = version.substring( firstDotIndex + 1, secondDotIndex );
+
+        int v = Integer.parseInt( majorVersion );
+
+        return v > 2 ? "2" : majorVersion;
+    }
+
+    /**
+     * Retrieve struts actions base package name from plugin configuration or use project groupId if not set
+     * 
+     * @return String
+     */
+    private String getBasePackage()
+    {
+        if ( strutsProps != null && strutsProps.get( "base-package" ) != null )
+        {
+            return (String) strutsProps.get( "base-package" );
+        }
+        return config.getProject().getGroupId();
+    }
+
+    /**
+     * Retrieve Struts servlet url-pattern from plugin configuration and convert it to the code MyEclipse uses. If not
+     * set, use "*.do" as default
+     * 
+     * @return String
+     */
+    private String getStrutsPattern()
+    {
+        if ( strutsProps != null && strutsProps.get( "pattern" ) != null )
+        {
+            String pattern = (String) strutsPatterns.get( strutsProps.get( "pattern" ) );
+            return pattern != null ? pattern : (String) strutsPatterns.get( MYECLIPSE_STRUTS_DEFAULT_PATTERN );
+        }
+        return (String) strutsPatterns.get( MYECLIPSE_STRUTS_DEFAULT_PATTERN );
+    }
+
+    /**
+     * Retrieve Struts servlet name from plugin configuration. Use "action" as default
+     * 
+     * @return
+     */
+    private String getStrutsServletName()
+    {
+        if ( strutsProps != null && strutsProps.get( "servlet-name" ) != null )
+        {
+            return (String) strutsProps.get( "servlet-name" );
+        }
+        return MYECLIPSE_STRUTS_SERVLET_DEFAULT_NAME;
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java?rev=599461&r1=599460&r2=599461&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java Thu Nov 29 06:43:17 2007
@@ -22,8 +22,6 @@
 
 public class EclipseCodeFormatterProfile
 {
-    private static final String ELT_PROFILES = "profiles";
-
     private static final String ELT_PROFILE = "profile";
 
     /**

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties?rev=599461&r1=599460&r2=599461&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties Thu Nov 29 06:43:17 2007
@@ -40,4 +40,6 @@
 
 IdeDependency.cantreadfile=Unable to read file: {0}
 
-Rad6LibCopier.cantdeletefile=Failed to delete file: {0}
\ No newline at end of file
+Rad6LibCopier.cantdeletefile=Failed to delete file: {0}
+
+MyEclipseSpringBeansWriter.springVersionNotFound=Spring must be declared in the project's dependencies to generate .springBeans file.

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java Thu Nov 29 06:43:17 2007
@@ -0,0 +1,60 @@
+package org.apache.maven.plugin.eclipse;
+
+/**
+ * Unit Tests for MyEclipse plugin
+ * 
+ * @author <a href="mailto:olivier.jacob@gmail.com">Olivier Jacob</a>
+ */
+public class MyEclipsePluginTest
+    extends AbstractEclipsePluginTestCase
+{
+    /**
+     * Web project, no spring/struts/hibernate capability, J2EE 1.3
+     * 
+     * @throws Exception
+     */
+    public void testMyEclipseProject01()
+        throws Exception
+    {
+        testMyEclipseProject( "project-myeclipse-01" );
+    }
+
+    /**
+     * Web project, no spring/struts/hibernate capability, J2EE 1.4
+     * 
+     * @throws Exception
+     */
+    public void testMyEclipseProject02()
+        throws Exception
+    {
+        testMyEclipseProject( "project-myeclipse-02" );
+    }
+
+    /**
+     * Simple project with Spring capability
+     * 
+     * @throws Exception
+     */
+    public void testMyEclipseProject03()
+        throws Exception
+    {
+        testMyEclipseProject( "project-myeclipse-03" );
+    }
+
+    /**
+     * Simple project with Spring and Hibernate capabilities
+     * 
+     * @throws Exception
+     */
+    public void testMyEclipseProject04()
+        throws Exception
+    {
+        testMyEclipseProject( "project-myeclipse-04" );
+    }
+
+    private void testMyEclipseProject( String project )
+        throws Exception
+    {
+        testProject( project, null, "myeclipse-clean", "myeclipse" );
+    }
+}

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/MyEclipsePluginTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath Thu Nov 29 06:43:17 2007
@@ -0,0 +1,9 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" output="/src/main/webapp/WEB-INF/classes"/>
+  <classpathentry kind="src" path="src/main/resources" output="/src/main/webapp/WEB-INF/classes" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE13_CONTAINER"/>
+</classpath>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.classpath
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.mymetadata
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.mymetadata?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.mymetadata (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.mymetadata Thu Nov 29 06:43:17 2007
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-module type="WEB" name="maven-eclipse-plugin-test-project-myeclipse-01" id="maven-eclipse-plugin-test-project-myeclipse-01" context-root="/maven-eclipse-plugin-test-project-myeclipse-01" j2ee-spec="1.3" archive="maven-eclipse-plugin-test-project-myeclipse-01.war">
+  <attributes>
+    <attribute name="webrootdir" value="src/main/webapp"/>
+  </attributes>
+</project-module>

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project Thu Nov 29 06:43:17 2007
@@ -0,0 +1,26 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-myeclipse-01</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.wst.validation.validationbuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+    <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/expected/.project
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml Thu Nov 29 06:43:17 2007
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>eclipse</groupId>
+  <artifactId>maven-eclipse-plugin-test-project-myeclipse-01</artifactId>
+  <version>99.0</version>
+  <packaging>war</packaging>
+  <name>Projet MyEclipse 01</name>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-eclipse-plugin</artifactId>
+        <version>test</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <!-- Need a servlet-api or j2ee dependency to resolve which classpath container to use -->
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.3</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/DummyClass.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/DummyClass.txt?rev=599461&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/DummyClass.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/java/DummyClass.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/resources/dummy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/resources/dummy?rev=599461&view=auto
==============================================================================
    (empty)

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml Thu Nov 29 06:43:17 2007
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app version="2.4" 
+	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/web-app_2_4.xsd">
+  <welcome-file-list>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+</web-app>

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp Thu Nov 29 06:43:17 2007
@@ -0,0 +1,26 @@
+<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
+<%
+String path = request.getContextPath();
+String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <base href="<%=basePath%>">
+    
+    <title>My JSP 'index.jsp' starting page</title>
+	<meta http-equiv="pragma" content="no-cache">
+	<meta http-equiv="cache-control" content="no-cache">
+	<meta http-equiv="expires" content="0">    
+	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
+	<meta http-equiv="description" content="This is my page">
+	<!--
+	<link rel="stylesheet" type="text/css" href="styles.css">
+	-->
+  </head>
+  
+  <body>
+    This is my JSP page. <br>
+  </body>
+</html>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/DummyTestClass.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/DummyTestClass.txt?rev=599461&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/DummyTestClass.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/java/DummyTestClass.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/resources/dummy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-01/src/test/resources/dummy?rev=599461&view=auto
==============================================================================
    (empty)

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath Thu Nov 29 06:43:17 2007
@@ -0,0 +1,9 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" output="/src/main/webapp/WEB-INF/classes"/>
+  <classpathentry kind="src" path="src/main/resources" output="/src/main/webapp/WEB-INF/classes" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
+</classpath>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.classpath
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.mymetadata
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.mymetadata?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.mymetadata (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.mymetadata Thu Nov 29 06:43:17 2007
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-module type="WEB" name="maven-eclipse-plugin-test-project-myeclipse-02" id="maven-eclipse-plugin-test-project-myeclipse-02" context-root="/myapp" j2ee-spec="1.4" archive="maven-eclipse-plugin-test-project-myeclipse-02.war">
+  <attributes>
+    <attribute name="webrootdir" value="src/main/webapp"/>
+  </attributes>
+</project-module>

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project Thu Nov 29 06:43:17 2007
@@ -0,0 +1,26 @@
+<projectDescription>
+  <name>maven-eclipse-plugin-test-project-myeclipse-02</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
+    </buildCommand>
+    <buildCommand>
+      <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.wst.validation.validationbuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+    <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/expected/.project
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml Thu Nov 29 06:43:17 2007
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>eclipse</groupId>
+  <artifactId>maven-eclipse-plugin-test-project-myeclipse-02</artifactId>
+  <version>99.0</version>
+  <packaging>war</packaging>
+  <name>Projet MyEclipse 02</name>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-eclipse-plugin</artifactId>
+        <version>test</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <configuration>
+          <warContextRoot>/myapp</warContextRoot>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <!-- Need a servlet-api or j2ee dependency to resolve which classpath container to use -->
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/DummyClass.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/DummyClass.txt?rev=599461&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/DummyClass.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/java/DummyClass.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/resources/dummy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/resources/dummy?rev=599461&view=auto
==============================================================================
    (empty)

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml Thu Nov 29 06:43:17 2007
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app version="2.4" 
+	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/web-app_2_4.xsd">
+  <welcome-file-list>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+</web-app>

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/index.jsp?rev=599461&view=auto
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/index.jsp (added)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-myeclipse-02/src/main/webapp/index.jsp Thu Nov 29 06:43:17 2007
@@ -0,0 +1,26 @@
+<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
+<%
+String path = request.getContextPath();
+String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <base href="<%=basePath%>">
+    
+    <title>My JSP 'index.jsp' starting page</title>
+	<meta http-equiv="pragma" content="no-cache">
+	<meta http-equiv="cache-control" content="no-cache">
+	<meta http-equiv="expires" content="0">    
+	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
+	<meta http-equiv="description" content="This is my page">
+	<!--
+	<link rel="stylesheet" type="text/css" href="styles.css">
+	-->
+  </head>
+  
+  <body>
+    This is my JSP page. <br>
+  </body>
+</html>