brett       2004/10/30 04:14:13

  Modified:    src/java/org/apache/maven Tag: MAVEN-1_0-BRANCH
                        MavenUtils.java
               xdocs    Tag: MAVEN-1_0-BRANCH changes.xml
  Log:
  PR: MAVEN-1469
  spit an error instead of infinitely recursing when extending the current POM,
  which could happen accidentally through a bad expression
  Not currently smart enough to detect a full cycle, though that is highly
  unlikely.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.107.4.25 +14 -2     maven/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.107.4.24
  retrieving revision 1.107.4.25
  diff -u -r1.107.4.24 -r1.107.4.25
  --- MavenUtils.java   24 Oct 2004 02:07:31 -0000      1.107.4.24
  +++ MavenUtils.java   30 Oct 2004 11:14:13 -0000      1.107.4.25
  @@ -49,6 +49,7 @@
   import java.io.ByteArrayOutputStream;
   import java.io.File;
   import java.io.FileInputStream;
  +import java.io.FileNotFoundException;
   import java.io.IOException;
   import java.io.InputStream;
   import java.io.StringReader;
  @@ -225,8 +226,19 @@
               project.setExtend( pomToExtend );
   
               File parentPom = new File( pomToExtend );
  +            parentPom = parentPom.getCanonicalFile();
  +            if ( !parentPom.exists() )
  +            {
  +                throw new FileNotFoundException( "Parent POM not found: " + 
parentPom );
  +            }
  +
  +            String parentPomPath = parentPom.getPath();
  +            if ( parentPomPath.equals( projectDescriptor.getCanonicalPath() ) )
  +            {
  +                throw new MavenException( "Parent POM is equal to the current POM" 
);
  +            }
   
  -            Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() 
);
  +            Project parent = (Project) parentPoms.get( parentPomPath );
               if ( parent == null )
               {
                   parent = getNonJellyProject( parentPom, parentContext, true );
  
  
  
  No                   revision
  No                   revision
  1.14.4.44 +1 -0      maven/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven/xdocs/changes.xml,v
  retrieving revision 1.14.4.43
  retrieving revision 1.14.4.44
  diff -u -r1.14.4.43 -r1.14.4.44
  --- changes.xml       30 Oct 2004 09:31:49 -0000      1.14.4.43
  +++ changes.xml       30 Oct 2004 11:14:13 -0000      1.14.4.44
  @@ -25,6 +25,7 @@
     </properties>
     <body>
       <release version="1.0.1-SNAPSHOT" date="in CVS MAVEN-1_0-BRANCH">
  +      <action dev="brett" type="fix" issue="MAVEN-1469">Give an error message if 
the parent pom is not valid</action>
         <action dev="brett" type="fix" issue="MAVEN-1439" due-to="Shinobu 
Kawai">Allow the property <code>maven.mode.online</code> to work, but be overridden by 
the <code>-o</code> command line option</action>
         <action dev="brett" type="update">No longer default the 
maven.repo.central[.directory] properties to upload to ibiblio as access is 
restricted</action>
         <action dev="brett" type="fix" issue="MAVEN-1477">Document mirrors of the 
Maven repository at ibiblio</action>
  
  
  

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

Reply via email to