maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven/src/test/touchstone-build/src/reactor-build/username_test maven.xml
Date Tue, 10 Jun 2003 03:15:39 GMT
jvanzyl     2003/06/09 20:15:39

  Modified:    .        maven.xml
               src/test/touchstone-build/src/reactor-build/username_test
                        maven.xml
  Added:       .        build-bootstrap-core.xml
  Log:
  o Adding a build-bootstrap-core.xml file that only goes through building
    what is absolutely necessary to get to the other side. In searching
    for problem with the failing bootstrap I don't want to have to
    build all the plugins. I have my own dirty shell script that I've always used
    but this will make it easier for anyone just trying to get from
    one end of the tunnel to the other.
  
  Revision  Changes    Path
  1.84      +14 -0     maven/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven/maven.xml,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- maven.xml	22 Apr 2003 11:48:49 -0000	1.83
  +++ maven.xml	10 Jun 2003 03:15:39 -0000	1.84
  @@ -60,6 +60,20 @@
       />
     </goal>
   
  +  <goal 
  +    name="maven:core-plugins-build"
  +    description="Build each Maven plugin into an installable jar">
  +
  +    <maven:reactor
  +      basedir="${maven.src.dir}/plugins-build"
  +      includes="clean/project.xml,jar/project.xml,java/project.xml,license/project.xml,plugin/project.xml,test/project.xml,touchstone/project.xml,touchstone-partner/project.xml"
  +      excludes="examples/*"
  +      goals="clean,plugin"
  +      banner="Building"
  +      ignoreFailures="false"
  +    />
  +  </goal>
  +
     <goal name="maven:plugins-clean"
       description="Cleans all plugin projects">
   
  
  
  
  1.1                  maven/build-bootstrap-core.xml
  
  Index: build-bootstrap-core.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project name="Maven" default="bootstrap" basedir=".">
  
    <property file="${user.home}/build.properties"/>
    <property file="${basedir}/project.properties"/>
    <property file="${basedir}/build-bootstrap.properties"/>
    <property environment="env"/>
    <property name="maven.home" value="${env.MAVEN_HOME}"/>
  
  
    <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>
  <echo>
  +----------------------------------------------------------
  | WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  |
  |  Maven bootstrap now creates a repository in
  |  $${user.home}/.maven/repository
  |  if you do not have the maven.repo.local property set
  |  before bootstrapping.
  |
  |  Maven bootstrap also expands plugins to
  |  $${user.home}/.maven/plugins
  |  if you do not have the MAVEN_HOME_LOCAL environment
  |  variable or
  |  maven.home.local property set before bootstrapping.
  |
  |  This feature is to accomodate the new ability of Maven
  |  to work from a read only install to MAVEN_HOME.
  |
  | WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  +----------------------------------------------------------
  </echo>
    </target>
  
    <!-- ===================================================================== -->
    <!-- B O O T S T R A P                                                     -->
    <!-- ===================================================================== -->
  
    <target name="bootstrap" depends="env,check-properties,bootstrap-compile">
  
  <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | L O A D I N G  B O O T S T R A P  T A S K D E F                  |
  |                                                                  |
  +------------------------------------------------------------------+
  </echo>
  
      <taskdef
        name="bootstrap"
        classname="org.apache.maven.BootstrapTask">
        <classpath>
          <path location="${maven.bootstrap.classes}"/>
        </classpath>
      </taskdef>
  
  <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | R U N N I N G  B O O T S T R A P  T A S K                        |
  |                                                                  |
  +------------------------------------------------------------------+
  </echo>
  
      <!-- The proxy values will be used if the values are actually set -->
  
      <bootstrap
        projectDescriptor="project.xml"
        baseUrl="${maven.get.jars.baseUrl}/"
        mavenLocalRepo="${maven.repo.local}"
        online="${maven.bootstrap.online}"
        proxyHost="${maven.proxy.host}"
        proxyUserName="${maven.proxy.username}"
        proxyPassword="${maven.proxy.password}"
        proxyPort="${maven.proxy.port}"
      />
  
  <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | C O M P I L I N G  M A V E N  S O U R C E S  U S I N G  A N T    |
  |                                                                  |
  +------------------------------------------------------------------+
  </echo>
  
      <delete dir="${maven.bootstrap.phase1.classes}"/>
      <mkdir dir="${maven.bootstrap.phase1.classes}"/>
  
      <javac
        destdir="${maven.bootstrap.phase1.classes}"
        debug="on"
        deprecation="off"
        optimize="off">
        <classpath refid="bootstrap-classpath"/>
        <src>
          <path location="src/java"/>
        </src>
      </javac>
  
      <copy todir="${maven.bootstrap.phase1.classes}">
        <fileset dir="src/conf">
          <include name="*.properties"/>
          <include name="*.jelly"/>
        </fileset>
      </copy>
  
      <copy todir="${maven.bootstrap.phase1.classes}/org/apache/maven/messages">
        <fileset dir="src/messages"/>
      </copy>
  
  <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | C R E A T I N G  M A V E N  J A R  W I T H  A N T                |
  |                                                                  |
  +------------------------------------------------------------------+
  </echo>
  
      <jar jarfile="${maven.bootstrap.dir}/maven.jar">
        <fileset dir="${maven.bootstrap.phase1.classes}">
          <include name="**/*.class"/>
          <include name="**/*.properties"/>
          <include name="**/*.jelly"/>
          <include name="**/messages.*"/>
          <exclude name="**/package.html"/>
        </fileset>
      </jar>
  
    <!-- ===================================================================== -->
    <!-- P H A S E  1  I N S T A L L                                           -->
    <!-- ===================================================================== -->
    <!-- This will produce a functional Maven install. The only plugins that   -->
    <!-- are installed are the:                                                -->
    <!--                                                                       -->
    <!-- a) java                                                               -->
    <!-- b) test                                                               -->
    <!-- c) touchstone                                                         -->
    <!-- d) touchstone-partner                                                 -->
    <!-- ===================================================================== -->
  
  <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | C R E A T I N G  P H A S E  1  I N S T A L L                     |
  |                                                                  |
  +------------------------------------------------------------------+
  </echo>
  
      <!-- Create the install directory -->
  
      <delete dir="${maven.bootstrap.install.dir}"/>
      <mkdir dir="${maven.bootstrap.install.dir}"/>
      <mkdir dir="${maven.bootstrap.install.dir}/bin"/>
      <mkdir dir="${maven.bootstrap.install.dir}/lib"/>
      <mkdir dir="${maven.bootstrap.install.dir}/plugins"/>
  
      <!-- Copy Maven's scripts into the install bin directory -->
  
      <copy todir="${maven.bootstrap.install.dir}/bin">
        <fileset dir="src/bin"/>
      </copy>
  
      <!-- Copy Maven's dependencies into install lib directory -->
  
      <copy
        todir="${maven.bootstrap.install.dir}/lib"
        flatten="yes">
        <fileset dir="${maven.repo.local}">
          <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">
        <fileset dir="${maven.bootstrap.install.dir}/lib">
          <include name="xml-apis*.jar" />
          <include name="xerces*.jar" />
          <include name="piccolo*.jar" />
        </fileset>
      </copy>
  
      <!-- Install maven in the lib directory -->
  
      <copy
        file="${maven.bootstrap.dir}/maven.jar"
        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"
        overwrite="yes"
      />
      <copy
        file="${maven.bootstrap.dir}/maven.jar"
        todir="${maven.home.local}/repository/maven/jars"
        overwrite="yes"
      />
  
      <copy todir="${maven.bootstrap.install.dir}/plugins">
        <fileset dir="src/plugins-build">
          <include name="clean/**"/>
          <include name="jar/**"/>
          <include name="java/**"/>
          <include name="test/**"/>
          <include name="license/**"/>
          <include name="touchstone/**"/>
          <include name="touchstone-partner/**"/>
          <include name="plugin/**"/>
          <include name="project.xml"/>
          <exclude name="**/maven.xml"/>
          <exclude name="**/target/**"/>
        </fileset>
      </copy>
  
      <antcall target="clean-maven-home"/>
  
      <copy todir="${maven.home}">
        <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 -->
      <chmod file="${maven.home}/bin/maven" perm="+x"/>
  
      <condition property="maven.script" value="maven.bat">
        <and>
          <os family="windows" />
          <equals arg1="${maven.script}" arg2="$${maven.script}" />
        </and>
      </condition>
      <condition property="maven.script" value="maven">
          <equals arg1="${maven.script}" arg2="$${maven.script}" />
      </condition>
  
      <property name="maven.command" value="${maven.home}/bin/${maven.script}"/>
  
      <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | B U I L D I N G  T H E  P L U G I N S                            |
  |                                                                  |
  +------------------------------------------------------------------+
      </echo>
  
      <exec
        executable="${maven.command}"
        failonerror="true">
        <arg value="-Dmaven.home.local=${maven.home.local}"/>
        <arg value="-Dmaven.repo.local=${maven.repo.local}"/>
        <arg value="${maven.bootstrap.online}"/>
        <arg value="maven:core-plugins-build"/>
        <arg value="-e"/>
      </exec>
  
      <!--
      <exec
        executable="${maven.command}"
        failonerror="true">
        <arg value="${maven.bootstrap.online}"/>
        <arg value="java:jar"/>
        <arg value="-e"/>
      </exec>
      -->
  
  
      <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | I N S T A L L I N G  T H E  P L U G I N S                        |
  |                                                                  |
  +------------------------------------------------------------------+
      </echo>
  
      <delete dir="${maven.bootstrap.install.dir}/plugins"/>
      <mkdir dir="${maven.bootstrap.install.dir}/plugins"/>
  
      <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"/>
          <exclude name="**/target/maven-jdiff-plugin*.jar"/>
          <exclude name="**/target/maven-xdoclet-plugin*.jar"/>
        </fileset>
      </copy>
  
      <echo>
  +------------------------------------------------------------------+
  |                                                                  |
  | B U I L D I N G  M A V E N  W I T H  I T S E L F                 |
  |                                                                  |
  +------------------------------------------------------------------+
      </echo>
  
      <exec executable="${maven.command}" failonerror="true">
        <arg value="-Dmaven.home.local=${maven.home.local}"/>
        <arg value="-Dmaven.repo.local=${maven.repo.local}"/>
        <arg value="${maven.bootstrap.online}"/>
        <arg value="clean"/>
        <arg value="jar:jar"/>
      </exec>
  
      <antcall target="clean-maven-home"/>
  
      <!-- Use the newly created maven.jar -->
  
      <copy
        file="${basedir}/target/maven.jar"
        todir="${maven.repo.local}/maven/jars"
        overwrite="yes"
      />
  
      <copy
        file="${basedir}/target/maven.jar"
        todir="${maven.bootstrap.install.dir}/lib"
        overwrite="yes"
      />
  
      <copy
        file="${basedir}/src/xsd/maven-project.xsd"
        todir="${maven.bootstrap.install.dir}"
        overwrite="yes"
      />
  
      <copy
        file="${basedir}/src/xsd/maven-navigation-1.0.xsd"
        todir="${maven.bootstrap.install.dir}"
        overwrite="yes"
      />
  
      <copy todir="${maven.home}">
        <fileset dir="${maven.bootstrap.install.dir}"/>
      </copy>
  
      <chmod file="${maven.home}/bin/maven" perm="+x"/>
  
    </target>
  
    <!-- ===================================================================== -->
    <!-- B O O T S T R A P  C O M P I L E                                      -->
    <!-- ===================================================================== -->
    <!-- Compile our bootstrap helper classes and the HttpUtils class.         -->
    <!-- ===================================================================== -->
  
    <target name="bootstrap-compile">
  
      <delete dir="${maven.bootstrap.dir}"/>
      <mkdir dir="${maven.bootstrap.classes}"/>
  
      <javac
        destdir="${maven.bootstrap.classes}"
        debug="on"
        deprecation="off"
        optimize="off">
        <src path="src"/>
        <include name="bootstrap/**"/>
        <include name="java/**/HttpUtils*"/>
      </javac>
  
    </target>
  
    <!-- ===================================================================== -->
    <!-- P R O P E R T I E S  C H E C K                                        -->
    <!-- ===================================================================== -->
    <!-- In order to bootstrap Maven you must have the following               -->
    <!-- properties defined in order for the bootstrap to work                 -->
    <!-- correctly:                                                            -->
    <!--                                                                       -->
    <!-- ${maven.home}: Maven installation directory                           -->
    <!-- ===================================================================== -->
  
    <target
      name="check-properties"
      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="" />
        </condition>
  
        <!-- are we online via a proxy -->
        <condition property="proxied-online">
          <and>
            <not><equals arg1="${maven.proxy.host}" arg2="$${maven.proxy.host}"/></not>
            <equals arg1="${maven.bootstrap.online}" arg2="" />
          </and>
        </condition>
  
    </target>
  
    <target
      name="check-maven-repo-local"
      unless="maven.repo.local">
      <!-- we default the local repo to write in the local home -->
      <!-- if we don't then -->
      <property name="maven.repo.local" location="${maven.home.local}/repository"/>
    </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" >
      <!-- last resort , if already set no worries -->
      <property name="maven.home.local" location="${user.home}/.maven"/>
    </target>
    <target
      name="check-maven-home"
      unless="maven.home">
      <fail>
        +------------------------------------------------------------------
        | ERROR!
        |
        | You must set ${maven.home} in your ${user.home}/build.properties
        | or ${project.home}/project.properties
        |
        | Please refer to the bootstrap document:
        | http://maven.apache.org/start/bootstrap.html
        +------------------------------------------------------------------
      </fail>
    </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>
  
  </project>
  
  
  
  1.3       +4 -0      maven/src/test/touchstone-build/src/reactor-build/username_test/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/test/touchstone-build/src/reactor-build/username_test/maven.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- maven.xml	5 Jun 2003 19:55:02 -0000	1.2
  +++ maven.xml	10 Jun 2003 03:15:39 -0000	1.3
  @@ -7,6 +7,8 @@
   
       <goal name="run">
         
  +      <echo>!!!! ${maven.username}</echo>
  +      
         <!-- 
         
         In order for this to pass I seem to have to coerce the value in the
  @@ -18,6 +20,8 @@
         
         -->
         <ant:property name="mavenUserName" value="${maven.username}"/>
  +      
  +      <echo>!!!! ${mavenUserName}</echo>
         
         <j:if test="${mavenUserName != 'maven'}">
           <fail>username_test: maven.username not properly assigned from root project.</fail>
  
  
  

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


Mime
View raw message