vmassol     02/05/28 00:49:36

  Modified:    src/java/org/apache/maven UpdatePomCheck.java
               src/templates/build build-init.xml
  Log:
  some additional comments
  
  Revision  Changes    Path
  1.4       +25 -9     
jakarta-turbine-maven/src/java/org/apache/maven/UpdatePomCheck.java
  
  Index: UpdatePomCheck.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/UpdatePomCheck.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UpdatePomCheck.java       27 May 2002 12:19:51 -0000      1.3
  +++ UpdatePomCheck.java       28 May 2002 07:49:35 -0000      1.4
  @@ -62,10 +62,28 @@
   import org.apache.maven.executor.AbstractExecutor;
   
   /**
  - * XML project descriptor validator.
  + * XML project descriptor validator. This tasks exposes 4 Ant properties :
  + * <ul>
  + *   <li>
  + *     pomUpdateRequired : true if the POM version specified in the project
  + *     descriptor does not match the current Maven version and thus Maven needs
  + *     to be updated
  + *   </li>
  + *   <li>
  + *     fromVersion : version defined in the project POM
  + *   </li>
  + *   <li>
  + *     toVersion : POM version of currently installed Maven
  + *   </li>
  + *   <li>
  + *     pomChecked : true. Tells the Ant build that the POM has been checked
  + *   </li>
  + * </ul>
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author dion
  - * @version $Id: UpdatePomCheck.java,v 1.3 2002/05/27 12:19:51 dion Exp $
  + * @author <a href="[EMAIL PROTECTED]">Vincent Massol</a>
  + * @version $Id: UpdatePomCheck.java,v 1.4 2002/05/28 07:49:35 vmassol Exp $
    */
   public class UpdatePomCheck extends AbstractExecutor
   {
  @@ -89,12 +107,11 @@
        */
       public File getProjectDescriptor()
       {
  -        return projectDescriptor;
  +        return this.projectDescriptor;
       }
   
       /**
  -     * Execute
  -     * @throws Exception when any error occurs
  +     * @see AbstractExecutor#execute()
        */
       public void execute() throws Exception
       {
  @@ -102,25 +119,24 @@
   
           try
           {
  -            project = MavenUtils.getProject(projectDescriptor);
  +            project = MavenUtils.getProject(this.projectDescriptor);
           }
           catch (Exception e)
           {
               e.printStackTrace();
           }
   
  -
           // Check and see if the version of the POM being used matches
           // the version of the POM that this version of Maven expects.
           // If the version property is null we know that we are dealing
  -        // with v1 of the POM because the <vesrion> element doesn't
  +        // with v1 of the POM because the <version> element doesn't
           // exist in v1 of the POM.
           if (project.getVersion() == null)
           {
               project.setVersion("1");
           }
   
  -        if (Integer.parseInt(project.getVersion()) != 
  +        if (Integer.parseInt(project.getVersion()) !=
               MavenConstants.POM_VERSION)
           {
               getProject().setProperty("pomUpdateRequired", "true");
  
  
  
  1.4       +16 -16    jakarta-turbine-maven/src/templates/build/build-init.xml
  
  Index: build-init.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/build-init.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build-init.xml    1 May 2002 19:51:05 -0000       1.3
  +++ build-init.xml    28 May 2002 07:49:36 -0000      1.4
  @@ -1,6 +1,7 @@
   <?xml version="1.0"?>
   
   <project name="$project.id" default="init" basedir="$antBasedir">
  +
     <!-- These are the bare minimum set of JARs that maven needs to operate.
          We don't want to make a big JAR containing everything so we
          are creating a special maven-classpath reference which is
  @@ -12,10 +13,10 @@
     -->
     
     <path id="maven-classpath">
  -  #foreach ($jar in $jars)
  -  <pathelement location="${lib.repo}/$jar"/>
  -  #end
  -  <pathelement location="${lib.repo}/maven.jar"/>
  +    #foreach ($jar in $jars)
  +      <pathelement location="${lib.repo}/$jar"/>
  +    #end
  +    <pathelement location="${lib.repo}/maven.jar"/>
     </path>
   
     <!-- ================================================================== -->
  @@ -75,25 +76,24 @@
     <target
       name="update-pom-check"
       unless="pomChecked">
  -    
  +
       <taskdef
         name="update-pom-check"
         classname="org.apache.maven.UpdatePomCheck">
         <classpath refid="maven-classpath"/>
       </taskdef>
       
  -    <!-- This task will place a property into the build called
  -         'pomUpdateRequired' if the version of the POM is out of
  -         sync with what Maven expects.
  +    <!-- This task will place several properties into the Ant context if
  +         the current Maven version does not match the POM file :
  +         - 'pomUpdateRequired' : 'true'
  +         - 'fromVersion' : POM version in POM project file
  +         - 'toVersion' : POM version that the current Maven handles
  +         This task will also define the following property :
  +         - 'pomChecked' : 'true' (to specify that the POM has been checked)
       -->
  -    
  -    <update-pom-check
  -      projectDescriptor="project.xml"
  -    />      
  -
  -    <echo>
  -      pomUpdateRequired = ${pomUpdateRequired}
  -    </echo>
  +    <update-pom-check projectDescriptor="project.xml"/>
  +
  +    <echo>pomUpdateRequired = ${pomUpdateRequired}</echo>
   
       <antcall target="callUpdateDescriptor"/>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to