summaryrefslogtreecommitdiff
path: root/rules/maven/fix-build-xml.patch
blob: b2b9a2a66a8d0699489705e5ab9ea9d333f516ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- maven.orig/build.xml
+++ maven/build.xml
@@ -39,6 +39,7 @@
   <property name="maven-compile.jvmargs" value="-Xmx512m -Xms512m"/>
   <property name="maven-compile.fork" value="true"/>
   <property name="maven-compile.maxmemory" value="512m"/>
+  <property environment="env" />
 
   <target name="initTaskDefs">
     <echo>Building ${distributionName} ...</echo>
@@ -48,7 +49,6 @@
   </target>
 
   <target name="isMavenHomeSet" depends="initTaskDefs">
-    <property environment="env" />
     <condition property="maven.home" value="${env.M2_HOME}">
       <isset property="env.M2_HOME" />
     </condition>
@@ -100,7 +100,10 @@
     <delete dir="bootstrap" />
   </target>
 
-  <target name="pull" depends="init" unless="skip.pull">
+  <target name="pull" depends="pull-network,pull-cached">
+  </target>
+
+  <target name="pull-network" depends="init" unless="skip.pull">
     <!-- Pull the dependencies that Maven needs to build -->
     <copy file="pom.xml" tofile="dependencies.xml" />
     <replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-start-comment--&gt;" value="&lt;!--" />
@@ -125,10 +128,19 @@
       <localRepository path="${maven.repo.local}" />
       <dependency groupId="org.codehaus.plexus" artifactId="plexus-component-metadata" version="${pom.properties.plexusVersion}" />
     </artifact:dependencies>
-
+  </target>
+  <target name="pull-cached" depends="init" if="skip.pull">
+    <!-- Fall back to the global env.CLASSPATH if unset -->
+    <property name="env.POM_CLASSPATH"     value="${env.CLASSPATH}"/>
+    <property name="env.MODELLO_CLASSPATH" value="${env.CLASSPATH}"/>
+    <property name="env.PMDG_CLASSPATH"    value="${env.CLASSPATH}"/>
+    <!-- Import the various classpaths -->
+    <path id="pom.pathid"    ><pathelement path="${env.POM_CLASSPATH}"    /></path>
+    <path id="modello.pathid"><pathelement path="${env.MODELLO_CLASSPATH}"/></path>
+    <path id="pmdg.pathid"   ><pathelement path="${env.PMDG_CLASSPATH}"   /></path>
   </target>
 
-  <target name="process-classes" depends="pull" description="generates plexus component metadata.">
+  <target name="process-classes" depends="compile-boot" description="generates plexus component metadata.">
     <mkdir dir="${basedir}/bootstrap/target" />
     <mkdir dir="${basedir}/bootstrap/target/classes" />