maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r330007 - /maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
Date Tue, 01 Nov 2005 08:25:23 GMT
Author: brett
Date: Tue Nov  1 00:25:17 2005
New Revision: 330007

URL: http://svn.apache.org/viewcvs?rev=330007&view=rev
Log:
allow overwriting instead of merging

Modified:
    maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java

Modified: maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java?rev=330007&r1=330006&r2=330007&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
(original)
+++ maven/components/trunk/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
Tue Nov  1 00:25:17 2005
@@ -85,15 +85,15 @@
      */
     private String jdkLevel;
 
+    /**
+     * Whether to update the existing project files or overwrite them.
+     * @parameter expression="${overwrite}" default-value="false"
+     */
+    private boolean overwrite;
+
     public void execute()
         throws MojoExecutionException
     {
-        if ( executedProject == null )
-        {
-            // backwards compat with alpha-2 only
-            executedProject = project;
-        }
-
         rewriteModule();
 
         if ( project.isExecutionRoot() ) 
@@ -118,11 +118,11 @@
 
         Reader reader = null;
 
-        Xpp3Dom module = null;
+        Xpp3Dom module;
         
         try
         {
-            if ( workspaceFile.exists() )
+            if ( workspaceFile.exists() && !overwrite )
             {
                 reader = new FileReader( workspaceFile );
             }
@@ -167,7 +167,7 @@
         try
         {
             Reader reader;
-            if ( projectFile.exists() )
+            if ( projectFile.exists() && !overwrite )
             {
                 reader = new FileReader( projectFile );
             }
@@ -255,7 +255,7 @@
         try
         {
             Reader reader;
-            if ( moduleFile.exists() )
+            if ( moduleFile.exists() && !overwrite )
             {
                 reader = new FileReader( moduleFile );
             }
@@ -692,7 +692,7 @@
      */
     private void setProjectScmType( Xpp3Dom content )
     { 
-        String scmType = null;
+        String scmType;
 
         scmType = getScmType();
         
@@ -713,7 +713,7 @@
      */
     protected String getScmType()
     {
-        String scmType = null;
+        String scmType;
 
         if ( project.getScm() == null )
         {
@@ -732,7 +732,7 @@
     
     protected String getScmType( String connection )
     {
-        String scmType = null;
+        String scmType;
         
         if ( connection != null )
         {



Mime
View raw message