You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/05/08 20:43:14 UTC

svn commit: r942440 - /maven/maven-3/trunk/build.xml

Author: bentmann
Date: Sat May  8 18:43:13 2010
New Revision: 942440

URL: http://svn.apache.org/viewvc?rev=942440&view=rev
Log:
o Made bootstrapper prompt user in case specified maven home already exists

Modified:
    maven/maven-3/trunk/build.xml

Modified: maven/maven-3/trunk/build.xml
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/build.xml?rev=942440&r1=942439&r2=942440&view=diff
==============================================================================
--- maven/maven-3/trunk/build.xml (original)
+++ maven/maven-3/trunk/build.xml Sat May  8 18:43:13 2010
@@ -54,6 +54,20 @@ END SNIPPET: ant-bootstrap -->
         </or>
       </condition>
     </fail>
+    <available property="maven.home.exists" file="${maven.home}" />
+  </target>
+
+  <target name="prompt-maven-home-exists" depends="isMavenHomeSet" if="maven.home.exists">
+    <input addproperty="maven.home.exists.continue" validargs="yes,no" defaultvalue="no">WARNING:
+The specified target directory
+  ${maven.home}
+already exists. It will be deleted and overwritten by the build.
+Do you want to continue?</input>
+    <fail message="Build was aborted by user">
+      <condition>
+        <equals arg1="${maven.home.exists.continue}" arg2="no" trim="true" casesensitive="false" />
+      </condition>
+    </fail>
   </target>
 
   <target name="init" depends="isMavenHomeSet">
@@ -229,7 +243,7 @@ This goal just validates the presence of
     <fail if="build.failed" message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}" />
   </target>
 
-  <target name="extract-assembly" depends="init,maven-assembly" description="extracts the maven assembly into maven.home">
+  <target name="extract-assembly" depends="init,prompt-maven-home-exists,maven-assembly" description="extracts the maven assembly into maven.home">
     <echo>Extracting assembly to ${maven.home} ...</echo>
     <!-- If we are starting from scratch make sure the directory is created -->
     <delete dir="${maven.home}" />