incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r672965 - /incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
Date Tue, 01 Jul 2008 00:50:55 GMT
Author: brett
Date: Mon Jun 30 17:50:55 2008
New Revision: 672965

URL: http://svn.apache.org/viewvc?rev=672965&view=rev
Log:
[NMAVEN-111] allow plugin to download from remote repositories by using the normal project
repository construction (note that this still works without a project by using the super model)
Submitted by: Maria Catherine Tan

Modified:
    incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java

Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java?rev=672965&r1=672964&r2=672965&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
(original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
Mon Jun 30 17:50:55 2008
@@ -19,31 +19,31 @@
 
 package org.apache.maven.dotnet.plugin.vsinstaller;
 
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.model.Dependency;
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-import org.apache.maven.artifact.Artifact;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
 import org.apache.maven.dotnet.artifact.ArtifactContext;
 import org.apache.maven.dotnet.artifact.NetDependenciesRepository;
 import org.apache.maven.dotnet.artifact.NetDependencyMatchPolicy;
-import org.apache.maven.dotnet.executable.NetExecutable;
 import org.apache.maven.dotnet.executable.ExecutionException;
-import org.apache.maven.dotnet.PlatformUnsupportedException;
+import org.apache.maven.dotnet.executable.NetExecutable;
+import org.apache.maven.dotnet.model.netdependency.NetDependency;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
 import org.apache.maven.dotnet.vendor.Vendor;
-import org.apache.maven.dotnet.model.netdependency.NetDependency;
-import org.apache.maven.settings.Settings;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.settings.Profile;
 import org.apache.maven.settings.Repository;
+import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
-import java.io.IOException;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.util.ArrayList;
 import java.util.List;
@@ -61,6 +61,11 @@
 {
 
     /**
+     * @parameter expression = "${project}"
+     */
+     public org.apache.maven.project.MavenProject mavenProject;
+
+    /**
      * The the path to the local maven repository.
      *
      * @parameter expression="${settings.localRepository}"
@@ -118,29 +123,7 @@
             (NetDependenciesRepository) repositoryRegistry.find( "net-dependencies" );
         String pomVersion = netRepository.getProperty( "nmaven.version");
 
-        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
-
-        //TODO: Only use active profiles
-        List<Profile> profiles = settings.getProfiles();
-        List<Repository> repositories = new ArrayList<Repository>();
-        for ( Profile profile : profiles )
-        {
-            if ( profile.getRepositories() != null )
-            {
-                repositories.addAll( profile.getRepositories() );
-            }
-            if ( profile.getPluginRepositories() != null )
-            {
-                repositories.addAll( profile.getPluginRepositories() );
-            }
-        }
-
-        for ( Repository repository : repositories )
-        {
-            remoteRepositories.add( new DefaultArtifactRepository( repository.getId(), repository.getUrl(),
-                                                                   new DefaultRepositoryLayout()
) );
-        }
-        artifactContext.init( null, remoteRepositories, new File( localRepository ) );
+        artifactContext.init( null, mavenProject.getRemoteArtifactRepositories(), new File(
localRepository ) );
 
         try
         {



Mime
View raw message