incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r673584 - /incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java
Date Thu, 03 Jul 2008 05:12:13 GMT
Author: brett
Date: Wed Jul  2 22:12:13 2008
New Revision: 673584

URL: http://svn.apache.org/viewvc?rev=673584&view=rev
Log:
[NMAVEN-154] Unable to build a project that uses a parent pom
Submitted by: Jan Ancajas

Modified:
    incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java

Modified: incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java?rev=673584&r1=673583&r2=673584&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java
(original)
+++ incubator/nmaven/branches/NMAVEN_0.14/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/ProjectFactory.java
Wed Jul  2 22:12:13 2008
@@ -28,6 +28,7 @@
 import org.apache.maven.dotnet.ArtifactType;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -99,21 +100,29 @@
             String parentPomName = FileUtils.filename( parent.getRelativePath() ).replace(
"\\", File.separator)
                 .replace( "/", File.separator);
             File parentPomFile = new File( pomFileDirectory, parentPomName );
-            FileReader fileReader = new FileReader( parentPomFile );
-
-            MavenXpp3Reader reader = new MavenXpp3Reader();
-            Model parentModel;
-            try
-            {
-                parentModel = reader.read( fileReader );
-            }
-            catch ( XmlPullParserException e )
+            
+            if (  parentPomFile.exists() ) // if pom resides in remote repo, Maven should
already handle this.
             {
-                throw new IOException( "NMAVEN-180-000: Unable to read model: Message = "
+ e.getMessage() );
+                FileReader fileReader = new FileReader( parentPomFile );
 
+                MavenXpp3Reader reader = new MavenXpp3Reader();
+                Model parentModel;
+                try
+                {
+                    parentModel = reader.read( fileReader );
+                }
+                catch ( XmlPullParserException e )
+                {
+                    throw new IOException( "NMAVEN-180-000: Unable to read model: Message
= " + e.getMessage() );
+
+                }
+                finally
+                {
+                    IOUtil.close( fileReader );
+                }
+                //Project parentProject = createProjectFrom( parentModel, parentPomFile.getParentFile()
);
+                //project.setParentProject( parentProject );
             }
-            //Project parentProject = createProjectFrom( parentModel, parentPomFile.getParentFile()
);
-            //project.setParentProject( parentProject );
         }
 
         //TODO: publickey/classifier



Mime
View raw message