incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r536991 - in /incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact: AssemblyResolver.java impl/ArtifactInstallerImpl.java impl/AssemblyResolverImpl.java
Date Thu, 10 May 2007 20:54:05 GMT
Author: sisbell
Date: Thu May 10 13:54:03 2007
New Revision: 536991

URL: http://svn.apache.org/viewvc?view=rev&rev=536991
Log:
Update: Resolving of the core NMaven dependencies no longer requires that the plugin has a
pom.xml file. This will allow standalone plugins that are not part of the nmaven lifecycle
to automatically download NMaven.

Modified:
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyResolver.java
    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/AssemblyResolver.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyResolver.java?view=diff&rev=536991&r1=536990&r2=536991
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyResolver.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyResolver.java
Thu May 10 13:54:03 2007
@@ -46,7 +46,6 @@
      * @param project             the maven project
      * @param sourceArtifact      the artifact to which the resolved dependencies belong
      * @param dependencies        the list of dependencies of the specified artifact
-     * @param pomFile             the pom file of the specified artifact
      * @param localRepositoryPath the path of the local Maven repository
      * @param addResolvedDependenciesToProject
      *                            true, if the resolved dependencies should be added the
the specified
@@ -58,6 +57,6 @@
      * @throws ArtifactNotFoundException
      */
     void resolveTransitivelyFor( MavenProject project, Artifact sourceArtifact, List<Dependency>
dependencies,
-                                 File pomFile, String localRepositoryPath, boolean addResolvedDependenciesToProject
)
+                                 String localRepositoryPath, boolean addResolvedDependenciesToProject
)
         throws ArtifactResolutionException, ArtifactNotFoundException;
 }

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=536991&r1=536990&r2=536991
==============================================================================
--- 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
Thu May 10 13:54:03 2007
@@ -141,7 +141,7 @@
     {
         this.logger = logger;
     }
-    
+
     public void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency>
dependencies )
         throws ArtifactResolutionException, ArtifactNotFoundException, ArtifactInstallationException
     {
@@ -156,7 +156,7 @@
         matchPolicies.add( new ProfileMatchPolicy( profile ) );
         dependencies.addAll( repository.getDependenciesFor( matchPolicies ) );
 
-        assemblyResolver.resolveTransitivelyFor( project, project.getArtifact(), dependencies,
project.getFile(),
+        assemblyResolver.resolveTransitivelyFor( project, project.getArtifact(), dependencies,
                                                  localRepository.getAbsolutePath(), false
);
 
         //Do Library Installs for Net Dependencies
@@ -375,6 +375,13 @@
     public void resolveAndInstallLibraryDependenciesFor( Dependency dependency )
         throws ArtifactInstallationException, ArtifactNotFoundException
     {
+
+        ArtifactRepository remoteArtifactRepository = new DefaultArtifactRepository( "nmaven",
+                                                                                     "http://localhost:8080/repository",
+                                                                                     new
DefaultRepositoryLayout() );
+        ArrayList remoteReps = new ArrayList();
+        remoteReps.add( remoteArtifactRepository );
+
         Artifact sourceArtifact = artifactFactory.createBuildArtifact( dependency.getGroupId(),
                                                                        dependency.getArtifactId(),
                                                                        dependency.getVersion(),
dependency.getType() );
@@ -389,8 +396,7 @@
                                                                                 sourceArtifact.getVersion(),
"jar" );
             try
             {
-                resolver.resolve( javaBindingArtifact, project.getRemoteArtifactRepositories(),
-                                  localArtifactRepository );
+                resolver.resolve( javaBindingArtifact, remoteReps, localArtifactRepository
);
             }
             catch ( ArtifactResolutionException e )
             {
@@ -425,7 +431,7 @@
         }
         catch ( IOException e )
         {
-           throw new ArtifactNotFoundException( "", sourceArtifact );
+            throw new ArtifactNotFoundException( "", sourceArtifact );
         }
         List<Dependency> sourceArtifactDependencies = model.getDependencies();
         localArtifactRepository =
@@ -439,7 +445,7 @@
                                                                                d.getVersion()
), d.getType(),
                                                                                         
        d.getClassifier(),
                                                                                         
        scope, null );
-             artifactDependencies.add(artifact1);
+            artifactDependencies.add( artifact1 );
 
         }
 
@@ -449,7 +455,7 @@
         try
         {
             result = resolver.resolveTransitively( artifactDependencies, sourceArtifact,
localArtifactRepository,
-                                                   project.getRemoteArtifactRepositories(),
metadata, null );
+                                                   remoteReps, metadata, null );
         }
         catch ( ArtifactResolutionException e )
         {

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=536991&r1=536990&r2=536991
==============================================================================
--- 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
Thu May 10 13:54:03 2007
@@ -20,7 +20,6 @@
 
 import org.apache.maven.dotnet.artifact.AssemblyResolver;
 import org.apache.maven.dotnet.artifact.AssemblyRepositoryLayout;
-import org.apache.maven.dotnet.artifact.ArtifactType;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -29,11 +28,11 @@
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.ResolutionNode;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.model.Dependency;
 
@@ -102,12 +101,11 @@
      * @see AssemblyResolver#resolveTransitivelyFor
      */
     public void resolveTransitivelyFor( MavenProject project, Artifact sourceArtifact, List<Dependency>
dependencies,
-                                        File pomFile, String localRepositoryPath,
-                                        boolean addResolvedDependenciesToProject )
+                                        String localRepositoryPath, boolean addResolvedDependenciesToProject
)
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
-        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, pomFile );
-        sourceArtifact.addMetadata( meta );
+        //ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, pomFile );
+        //sourceArtifact.addMetadata( meta );
 
         Set<Artifact> artifactDependencies = new HashSet<Artifact>();
         Set<Artifact> gacDependencies = new HashSet<Artifact>();
@@ -134,12 +132,17 @@
                 artifactDependencies.add( artifact );
             }
         }
+        ArtifactRepository remoteArtifactRepository = new DefaultArtifactRepository( "nmaven",
+                                                                                     "http://localhost:8080/repository",
+                                                                                     new
DefaultRepositoryLayout() );
+        ArrayList remoteReps = new ArrayList();
+        remoteReps.add( remoteArtifactRepository );
 
         ArtifactRepository localArtifactRepository =
             new DefaultArtifactRepository( "local", "file://" + localRepositoryPath, new
AssemblyRepositoryLayout() );
         ArtifactResolutionResult result = resolver.resolveTransitively( artifactDependencies,
sourceArtifact,
                                                                         localArtifactRepository,
-                                                                        project.getRemoteArtifactRepositories(),
+                                                                        remoteReps,
                                                                         metadata, gacFilter
);
         Set<Artifact> resolvedDependencies = result.getArtifacts();
         AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();



Mime
View raw message