You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by pl...@apache.org on 2003/05/05 01:41:45 UTC

cvs commit: maven build-bootstrap.xml

plynch      2003/05/04 16:41:45

  Modified:    .        build-bootstrap.xml
  Log:
  Applying part of patch for MAVEN-302 with modifications to copy the plugins for pahse-1 install to maven.home.local directory
  Also:
  o default maven.local.home to be first from properties, then environment, then default for last resort
  o log the env on bootstrap
  
  Revision  Changes    Path
  1.194     +53 -29    maven/build-bootstrap.xml
  
  Index: build-bootstrap.xml
  ===================================================================
  RCS file: /home/cvs/maven/build-bootstrap.xml,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- build-bootstrap.xml	22 Apr 2003 11:48:48 -0000	1.193
  +++ build-bootstrap.xml	4 May 2003 23:41:45 -0000	1.194
  @@ -6,11 +6,12 @@
     <property file="${basedir}/project.properties"/>
     <property file="${basedir}/build-bootstrap.properties"/>
     <property environment="env"/>
  -  <property name="maven.home" value="${env.MAVEN_HOME}"/>
  -  <property name="maven.repo.local" value="${maven.home}/repository"/>
  +  <property name="maven.home" location="${env.MAVEN_HOME}"/>
  +  <property name="maven.repo.local" location="${maven.home}/repository"/>
   
  -  <target name="env">
  -   <echo>maven.home = ${maven.home}</echo>    
  +  <target name="env" depends="check-properties">
  +   <echo>maven.home = ${maven.home}</echo>
  +   <echo>maven.home.local = ${maven.home.local}</echo>
      <echo>maven.repo.local = ${maven.repo.local}</echo>
     </target>
   
  @@ -18,7 +19,7 @@
     <!-- B O O T S T R A P                                                     -->
     <!-- ===================================================================== -->
   
  -  <target name="bootstrap" depends="check-properties,bootstrap-compile">
  +  <target name="bootstrap" depends="env,check-properties,bootstrap-compile">
   
   <echo>
   +------------------------------------------------------------------+
  @@ -28,14 +29,14 @@
   +------------------------------------------------------------------+
   </echo>
   
  -    <taskdef 
  +    <taskdef
         name="bootstrap"
         classname="org.apache.maven.BootstrapTask">
         <classpath>
           <path location="${maven.bootstrap.classes}"/>
         </classpath>
       </taskdef>
  -    
  +
   <echo>
   +------------------------------------------------------------------+
   |                                                                  |
  @@ -43,10 +44,10 @@
   |                                                                  |
   +------------------------------------------------------------------+
   </echo>
  -    
  +
       <!-- The proxy values will be used if the values are actually set -->
  -    
  -    <bootstrap 
  +
  +    <bootstrap
         projectDescriptor="project.xml"
         baseUrl="${maven.get.jars.baseUrl}/"
         mavenLocalRepo="${maven.repo.local}"
  @@ -129,7 +130,7 @@
   </echo>
   
       <!-- Create the install directory -->
  -    
  +
       <delete dir="${maven.bootstrap.install.dir}"/>
       <mkdir dir="${maven.bootstrap.install.dir}"/>
       <mkdir dir="${maven.bootstrap.install.dir}/bin"/>
  @@ -151,7 +152,7 @@
           <patternset refid="bootstrap-patternset"/>
         </fileset>
       </copy>
  -    
  +
       <!-- make the endorsed dir -->
       <mkdir dir="${maven.bootstrap.install.dir}/lib/endorsed" />
       <copy todir="${maven.bootstrap.install.dir}/lib/endorsed">
  @@ -169,9 +170,9 @@
         todir="${maven.bootstrap.install.dir}/lib"
         overwrite="true"
       />
  -    
  +
       <!-- Install maven in the local repository for the plugin builds -->
  -    
  +
       <copy
         file="${maven.bootstrap.dir}/maven.jar"
         todir="${maven.repo.local}/maven/jars"
  @@ -197,7 +198,15 @@
       <antcall target="clean-maven-home"/>
   
       <copy todir="${maven.home}">
  -      <fileset dir="${maven.bootstrap.install.dir}"/>
  +      <fileset dir="${maven.bootstrap.install.dir}">
  +        <exclude name="plugins/**" />
  +      </fileset>
  +    </copy>
  +    <!-- expanded plugins should be put in the maven.home.local -->
  +    <copy todir="${maven.home.local}">
  +      <fileset dir="${maven.bootstrap.install.dir}">
  +        <include name="plugins/**" />
  +      </fileset>
       </copy>
   
       <!-- Now we have a functional maven install -->
  @@ -214,7 +223,7 @@
       </condition>
   
       <property name="maven.command" value="${maven.home}/bin/${maven.script}"/>
  -    
  +
       <echo>
   +------------------------------------------------------------------+
   |                                                                  |
  @@ -222,18 +231,18 @@
   |                                                                  |
   +------------------------------------------------------------------+
       </echo>
  -    
   
  -    <exec 
  +    <exec
         executable="${maven.command}"
         failonerror="true">
  +      <arg value="-Dmaven.home.local=${maven.home.local}"/>
         <arg value="${maven.bootstrap.online}"/>
         <arg value="maven:plugins-build"/>
         <arg value="-e"/>
       </exec>
   
  -    <!--    
  -    <exec 
  +    <!--
  +    <exec
         executable="${maven.command}"
         failonerror="true">
         <arg value="${maven.bootstrap.online}"/>
  @@ -257,7 +266,7 @@
       <copy todir="${maven.bootstrap.install.dir}/plugins" flatten="yes">
         <fileset dir="src/plugins-build">
           <include name="**/target/maven*plugin*.jar"/>
  -        
  +
           <!-- Exclude plugins no one can be using -->
           <exclude name="**/target/maven-dependency-plugin*.jar"/>
           <exclude name="**/target/maven-graph-plugin*.jar"/>
  @@ -265,7 +274,7 @@
           <exclude name="**/target/maven-xdoclet-plugin*.jar"/>
         </fileset>
       </copy>
  -    
  +
       <echo>
   +------------------------------------------------------------------+
   |                                                                  |
  @@ -275,6 +284,7 @@
       </echo>
   
       <exec executable="${maven.command}" failonerror="true">
  +      <arg value="-Dmaven.home.local=${maven.home.local}"/>
         <arg value="${maven.bootstrap.online}"/>
         <arg value="clean"/>
         <arg value="jar:jar"/>
  @@ -283,7 +293,7 @@
       <antcall target="clean-maven-home"/>
   
       <!-- Use the newly created maven.jar -->
  -    
  +
       <copy
         file="${basedir}/target/maven.jar"
         todir="${maven.repo.local}/maven/jars"
  @@ -307,7 +317,7 @@
         todir="${maven.bootstrap.install.dir}"
         overwrite="yes"
       />
  -    
  +
       <copy todir="${maven.home}">
         <fileset dir="${maven.bootstrap.install.dir}"/>
       </copy>
  @@ -323,10 +333,10 @@
     <!-- ===================================================================== -->
   
     <target name="bootstrap-compile">
  -    
  +
       <delete dir="${maven.bootstrap.dir}"/>
       <mkdir dir="${maven.bootstrap.classes}"/>
  -    
  +
       <javac
         destdir="${maven.bootstrap.classes}"
         debug="on"
  @@ -352,7 +362,9 @@
   
     <target
       name="check-properties"
  -    depends="check-maven-home,check-maven-repo-local">
  +    depends="check-maven-home,check-maven-home-local-1,
  +              check-maven-home-local-2,check-maven-repo-local">
  +
         <!-- are we online? -->
         <condition property="online">
           <equals arg1="${maven.bootstrap.online}" arg2="" />
  @@ -365,6 +377,7 @@
             <equals arg1="${maven.bootstrap.online}" arg2="" />
           </and>
         </condition>
  +
     </target>
   
     <target
  @@ -383,6 +396,14 @@
       </fail>
     </target>
   
  +  <!-- doesn't mimic actual maven cause the properties files are loaded before -->
  +  <target name="check-maven-home-local-1" if="env.MAVEN_HOME_LOCAL">
  +    <property name="maven.home.local" location="env.MAVEN_HOME_LOCAL"/>
  +  </target>
  +  <target name="check-maven-home-local-2" unless="maven.home.local" >
  +    <!-- last resort -->
  +    <property name="maven.home.local" location="${user.home}/.maven"/>
  +  </target>
     <target
       name="check-maven-home"
       unless="maven.home">
  @@ -400,15 +421,18 @@
     </target>
   
     <target name="clean-maven-home">
  -    
  +
       <delete dir="${maven.home}/bin"/>
       <mkdir dir="${maven.home}/bin"/>
  -    
  +
       <delete dir="${maven.home}/lib"/>
       <mkdir dir="${maven.home}/lib"/>
   
       <delete dir="${maven.home}/plugins"/>
       <mkdir dir="${maven.home}/plugins"/>
  +
  +    <!-- cleanup the local plugins dir -->
  +    <delete dir="${maven.home.local}/plugins"/>
   
     </target>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org