incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r537257 - in /incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl: ArtifactInstallerImpl.java AssemblyResolverImpl.java
Date Fri, 11 May 2007 18:22:30 GMT
Author: sisbell
Date: Fri May 11 11:22:29 2007
New Revision: 537257

URL: http://svn.apache.org/viewvc?view=rev&rev=537257
Log:
Fixed a problem with the artifact installer trying to resolve and add GAC dependencies into
the local repo.

Modified:
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java

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=537257&r1=537256&r2=537257
==============================================================================
--- 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
Fri May 11 11:22:29 2007
@@ -35,6 +35,7 @@
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -454,7 +455,7 @@
         try
         {
             result = resolver.resolveTransitively( artifactDependencies, sourceArtifact,
localArtifactRepository,
-                                                   remoteArtifactRepositories, metadata,
null );
+                                                   remoteArtifactRepositories, metadata,
new GacFilter() );
         }
         catch ( ArtifactResolutionException e )
         {
@@ -640,7 +641,7 @@
         implements NetDependencyMatchPolicy
     {
         public boolean match( NetDependency netDependency )
-        {            
+        {
             return netDependency.getType().equals( ArtifactType.EXE.getPackagingType() )
||
                 netDependency.getType().equals( ArtifactType.NETPLUGIN.getPackagingType()
) ||
                 netDependency.getType().equals( ArtifactType.VISUAL_STUDIO_ADDIN.getPackagingType()
) ||
@@ -673,6 +674,15 @@
             }
 
             return profile.equals( netDependency.getProfile() );
+        }
+    }
+
+    private static class GacFilter
+        implements ArtifactFilter
+    {
+        public boolean include( org.apache.maven.artifact.Artifact artifact )
+        {
+            return !artifact.getType().startsWith( "gac" );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java?view=diff&rev=537257&r1=537256&r2=537257
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
Fri May 11 11:22:29 2007
@@ -97,7 +97,8 @@
      * @see AssemblyResolver#resolveTransitivelyFor
      */
     public void resolveTransitivelyFor( MavenProject project, Artifact sourceArtifact, List<Dependency>
dependencies,
-                                        List<ArtifactRepository> remoteArtifactRepositories,
ArtifactRepository localArtifactRepository,
+                                        List<ArtifactRepository> remoteArtifactRepositories,
+                                        ArtifactRepository localArtifactRepository,
                                         boolean addResolvedDependenciesToProject )
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
@@ -117,6 +118,7 @@
             {
                 logger.debug(
                     "NMAVEN-000-000: GAC Dependency = " + artifact.getType() + ", ID = "
+ artifact.getArtifactId() );
+                artifact.setResolved( true );
                 gacDependencies.add( artifact );
             }
             else
@@ -129,8 +131,8 @@
 
         ArtifactResolutionResult result = resolver.resolveTransitively( artifactDependencies,
sourceArtifact,
                                                                         localArtifactRepository,
-                                                                        remoteArtifactRepositories,
-                                                                        metadata, gacFilter
);
+                                                                        remoteArtifactRepositories,
metadata,
+                                                                        gacFilter );
         Set<Artifact> resolvedDependencies = result.getArtifacts();
         AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
 
@@ -139,7 +141,8 @@
             for ( Artifact artifact : resolvedDependencies )
             {
                 File orginalFileWithVersion = artifact.getFile();
-                orginalFileWithVersion.renameTo( new File( localArtifactRepository + "/"
+ layout.pathOf( artifact ) ) );
+                orginalFileWithVersion.renameTo(
+                    new File( localArtifactRepository + "/" + layout.pathOf( artifact ) )
);
             }
 
             resolvedDependencies.addAll( gacDependencies );



Mime
View raw message