You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2008/04/24 01:25:37 UTC

svn commit: r651102 - /maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml

Author: vsiveton
Date: Wed Apr 23 16:25:35 2008
New Revision: 651102

URL: http://svn.apache.org/viewvc?rev=651102&view=rev
Log:
o try to find mvn in PATH and M2_HOME variable

Modified:
    maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml

Modified: maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml?rev=651102&r1=651101&r2=651102&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml (original)
+++ maven/doxia/doxia-tools/trunk/doxia-ide/eclipse/download-eclipse.xml Wed Apr 23 16:25:35 2008
@@ -499,9 +499,50 @@
       name="maven.executable"
       value="mvn" />
 
+    <!-- Try to find mvn in the path or in the M2_HOME variable -->
+    <condition property="mvn.found">
+      <or>
+        <available
+          file="mvn.bat"
+          filepath="${env.M2_HOME}${file.separator}bin${path.separator}${env.Path}" />
+        <available
+          file="mvn.bat"
+          filepath="${env.M2_HOME}${file.separator}bin${path.separator}${env.PATH}" />
+        <available
+          file="mvn"
+          filepath="${env.M2_HOME}${file.separator}bin${path.separator}${env.PATH}" />
+      </or>
+    </condition>
+
+    <fail
+      unless="mvn.found"
+      message="You need to add the Maven executable in your PATH or add the M2_HOME env property." />
+
+    <!-- try to see if M2_HOME is set -->
+    <condition
+      property="mvn.bin.path"
+      value="${env.M2_HOME}${file.separator}bin${file.separator}">
+      <or>
+        <available
+          file="${env.M2_HOME}${file.separator}bin"
+          type="dir" />
+      </or>
+    </condition>
+    <!-- mvn is in the path -->
+    <property
+      name="mvn.bin.path"
+      value="" />
+
     <exec
-      failonerror="true"
-      executable="${env.M2_HOME}\bin\${maven.executable}">
+      failonerror="false"
+      executable="${mvn.bin.path}${maven.executable}">
+      <env
+        key="PATH"
+        path="${env.PATH}" />
+      <!-- windows -->
+      <env
+        key="Path"
+        path="${env.Path}" />
       <arg line="validate -f install-eclipse-repo.xml -N -Dinstall.dir=${install.dir}" />
     </exec>
   </target>