incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r536755 - in /incubator/nmaven/branches/SI_XPT: assemblies/NMaven.Core/src/main/csharp/Core/Impl/ components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ plugins/maven-resolver-plugin/src/main/java/org/apache/maven/d...
Date Thu, 10 May 2007 06:37:46 GMT
Author: sisbell
Date: Wed May  9 23:37:45 2007
New Revision: 536755

URL: http://svn.apache.org/viewvc?view=rev&rev=536755
Log:
Fixed problem with the installing of dependent files from remote repo.

Modified:
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
    incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs?view=diff&rev=536755&r1=536754&r2=536755
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
(original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
Wed May  9 23:37:45 2007
@@ -26,7 +26,6 @@
 using System.Collections.Generic;
 using System.Reflection;
 using System.Text;
-using test;
 
 namespace NMaven.Core.Impl
 {

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=536755&r1=536754&r2=536755
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
Wed May  9 23:37:45 2007
@@ -25,6 +25,7 @@
 import org.apache.maven.dotnet.artifact.ArtifactType;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -50,6 +51,7 @@
 import java.io.IOException;
 import java.io.FileWriter;
 import java.io.FileReader;
+import java.io.FileNotFoundException;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Set;
@@ -361,16 +363,56 @@
         }
 
         //Resolve all the specified dependencies
+        Artifact pomArtifact = artifactFactory.createProjectArtifact( dependency.getGroupId(),
+                                                                      dependency.getArtifactId(),
+                                                                      dependency.getVersion()
);
+        File pomArtifactFile = new File( localRepository, new AssemblyRepositoryLayout().pathOf(
pomArtifact ) );
+        FileReader fileReader;
+        try
+        {
+            fileReader = new FileReader( pomArtifactFile );
+        }
+        catch ( FileNotFoundException e )
+        {
+            throw new ArtifactNotFoundException( "", sourceArtifact );
+        }
+        MavenXpp3Reader reader = new MavenXpp3Reader();
+        Model model;
+        try
+        {
+            model = reader.read( fileReader );
+        }
+        catch ( XmlPullParserException e )
+        {
+            throw new ArtifactNotFoundException( "", sourceArtifact );
+
+        }
+        catch ( IOException e )
+        {
+           throw new ArtifactNotFoundException( "", sourceArtifact );
+        }
+        List<Dependency> sourceArtifactDependencies = model.getDependencies();
         localArtifactRepository =
             new DefaultArtifactRepository( "local", "file://" + localRepository, new AssemblyRepositoryLayout()
);
         Set<Artifact> artifactDependencies = new HashSet<Artifact>();
-        artifactDependencies.add( sourceArtifact );
-        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, pomFile );
+        for ( Dependency d : sourceArtifactDependencies )
+        {
+            String scope = ( d.getScope() == null ) ? Artifact.SCOPE_COMPILE : d.getScope();
+            Artifact artifact1 = artifactFactory.createDependencyArtifact( d.getGroupId(),
d.getArtifactId(),
+                                                                           VersionRange.createFromVersion(
+                                                                               d.getVersion()
), d.getType(),
+                                                                                        
        d.getClassifier(),
+                                                                                        
        scope, null );
+             artifactDependencies.add(artifact1);
+
+        }
+
+        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, null );
         sourceArtifact.addMetadata( meta );
         ArtifactResolutionResult result;
         try
         {
-            result = resolver.resolveTransitively( artifactDependencies, project.getArtifact(),
localArtifactRepository,
+            result = resolver.resolveTransitively( artifactDependencies, sourceArtifact,
localArtifactRepository,
                                                    project.getRemoteArtifactRepositories(),
metadata, null );
         }
         catch ( ArtifactResolutionException e )
@@ -381,6 +423,7 @@
         //Do local installing of the dependencies into exe and netplugin repo directories
         AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
         Set<Artifact> artifacts = result.getArtifacts();
+
         File destDir = new File( localRepository, layout.pathOf( sourceArtifact ) ).getParentFile();
         for ( Artifact artifact : artifacts )
         {

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java?view=diff&rev=536755&r1=536754&r2=536755
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
(original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
Wed May  9 23:37:45 2007
@@ -186,6 +186,7 @@
         matchPolicies.add( new ExecutableAndNetPluginMatchPolicy() );
         for ( Dependency dependency : repository.getDependenciesFor( matchPolicies ) )
         {
+            
             try
             {
                 artifactContext.getArtifactInstaller().resolveAndInstallLibraryDependenciesFor(
dependency, pomFile );



Mime
View raw message