You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ba...@apache.org on 2011/09/23 02:03:45 UTC

svn commit: r1174460 - in /maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse: ./ writers/ writers/workspace/

Author: baerrach
Date: Fri Sep 23 00:03:45 2011
New Revision: 1174460

URL: http://svn.apache.org/viewvc?rev=1174460&view=rev
Log:
Moved EclipseSettingsWriter into the writers.workspace directory.
EclipseWorkspaceWriter contains the source of truth for workspace files.
Duplicate private constants have been removed and now reference EclipseWorkspaceWriter values.

Added:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java
      - copied, changed from r1174450, maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java
Removed:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java
Modified:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
    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/workspace/EclipseWorkspaceWriter.java

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java?rev=1174460&r1=1174459&r2=1174460&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java Fri Sep 23 00:03:45 2011
@@ -22,6 +22,7 @@ import java.io.File;
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.eclipse.writers.workspace.EclipseWorkspaceWriter;
 import org.apache.maven.plugin.ide.IdeUtils;
 
 /**
@@ -49,36 +50,6 @@ public class EclipseCleanMojo
     private static final String FILE_DOT_PROJECT = ".project"; //$NON-NLS-1$
 
     /**
-     * Web Project definition file for Eclipse Web Tools Project (Release 1.0x).
-     */
-    private static final String DIR_DOT_SETTINGS = ".settings"; //$NON-NLS-1$
-
-    /**
-     * File name where the WTP component settings will be stored - WTP 1.0 name.
-     */
-    private static final String FILE_DOT_COMPONENT = ".settings/.component"; //$NON-NLS-1$
-
-    /**
-     * File name where the WTP component settings will be stored - WTP 1.5 name.
-     */
-    private static final String FILE_DOT_COMPONENT_15 = ".settings/org.eclipse.wst.common.component"; //$NON-NLS-1$
-
-    /**
-     * File name where Eclipse Project's Facet configuration will be stored.
-     */
-    private static final String FILE_FACET_CORE_XML = ".settings/org.eclipse.wst.common.project.facet.core.xml"; //$NON-NLS-1$
-
-    /**
-     * General project preferences.
-     */
-    private static final String FILE_ECLIPSE_JDT_CORE_PREFS = ".settings/org.eclipse.jdt.core.prefs"; //$NON-NLS-1$
-
-    /**
-     * AJDT preferences.
-     */
-    private static final String FILE_AJDT_PREFS = ".settings/org.eclipse.ajdt.ui.prefs"; //$NON-NLS-1$
-
-    /**
      * Packaging for the current project.
      * 
      * @parameter expression="${project.packaging}"
@@ -126,13 +97,7 @@ public class EclipseCleanMojo
         delete( new File( basedir, FILE_DOT_CLASSPATH ) );
         delete( new File( basedir, FILE_DOT_WTPMODULES ) );
 
-        delete( new File( basedir, FILE_DOT_COMPONENT ) );
-        delete( new File( basedir, FILE_DOT_COMPONENT_15 ) );
-        delete( new File( basedir, FILE_FACET_CORE_XML ) );
-        delete( new File( basedir, FILE_ECLIPSE_JDT_CORE_PREFS ) );
-        delete( new File( basedir, FILE_AJDT_PREFS ) );
-
-        File settingsDir = new File( basedir, DIR_DOT_SETTINGS );
+        File settingsDir = new File( basedir, EclipseWorkspaceWriter.DIR_DOT_SETTINGS );
         if ( settingsDir.exists() && settingsDir.isDirectory() && settingsDir.list().length == 0 )
         {
             delete( settingsDir );

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=1174460&r1=1174459&r2=1174460&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 Fri Sep 23 00:03:45 2011
@@ -46,8 +46,8 @@ import org.apache.maven.plugin.eclipse.w
 import org.apache.maven.plugin.eclipse.writers.EclipseManifestWriter;
 import org.apache.maven.plugin.eclipse.writers.EclipseOSGiManifestWriter;
 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.workspace.EclipseSettingsWriter;
 import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpApplicationXMLWriter;
 import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponent15Writer;
 import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponentWriter;

Copied: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java (from r1174450, maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java?p2=maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java&p1=maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java&r1=1174450&r2=1174460&rev=1174460&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java Fri Sep 23 00:03:45 2011
@@ -16,20 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.plugin.eclipse.writers;
+package org.apache.maven.plugin.eclipse.writers.workspace;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.Properties;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.model.Resource;
 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;
 
 /**
@@ -44,12 +45,8 @@ public class EclipseSettingsWriter
 
     private static final String JDK_1_2_SOURCES = "1.2"; //$NON-NLS-1$
 
-    private static final String FILE_ECLIPSE_JDT_CORE_PREFS = "org.eclipse.jdt.core.prefs"; //$NON-NLS-1$
-
     private static final String PROP_ECLIPSE_PREFERENCES_VERSION = "eclipse.preferences.version"; //$NON-NLS-1$
 
-    private static final String DIR_DOT_SETTINGS = ".settings"; //$NON-NLS-1$
-
     private static final String PROP_JDT_CORE_COMPILER_COMPLIANCE = "org.eclipse.jdt.core.compiler.compliance"; //$NON-NLS-1$
 
     private static final String PROP_JDT_CORE_COMPILER_SOURCE = "org.eclipse.jdt.core.compiler.source"; //$NON-NLS-1$
@@ -133,7 +130,7 @@ public class EclipseSettingsWriter
         // write the settings, if needed
         if ( !coreSettings.isEmpty() )
         {
-            File settingsDir = new File( config.getEclipseProjectDirectory(), DIR_DOT_SETTINGS ); //$NON-NLS-1$
+            File settingsDir = new File( config.getEclipseProjectDirectory(), EclipseWorkspaceWriter.DIR_DOT_SETTINGS ); //$NON-NLS-1$
 
             settingsDir.mkdirs();
 
@@ -143,7 +140,7 @@ public class EclipseSettingsWriter
             {
                 File oldCoreSettingsFile;
 
-                File coreSettingsFile = new File( settingsDir, FILE_ECLIPSE_JDT_CORE_PREFS );
+                File coreSettingsFile = new File( settingsDir, EclipseWorkspaceWriter.ECLIPSE_JDT_CORE_PREFS_FILE );
 
                 if ( coreSettingsFile.exists() )
                 {

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java?rev=1174460&r1=1174459&r2=1174460&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java Fri Sep 23 00:03:45 2011
@@ -28,7 +28,12 @@ public class EclipseWorkspaceWriter
      */
     public static final String ECLIPSE_CORE_RUNTIME_SETTINGS_DIR =
         ECLIPSE_PLUGINS_METADATA_DIR + "/org.eclipse.core.runtime/.settings"; //$NON-NLS-1$
-
+    
+    /**
+     * Directory where workspace specific settings are written.
+     */
+    public static final String DIR_DOT_SETTINGS = ".settings"; //$NON-NLS-1$   
+    
     /**
      * File that stores the Eclipse JDT Core preferences.
      */