Author: brett
Date: Tue Dec  6 05:18:56 2011
New Revision: 1210784

URL: http://svn.apache.org/viewvc?rev=1210784&view=rev
Log:
[NPANDAY-410] make sure the local repository is passed in

Modified:
    
incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java

Modified: 
incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java?rev=1210784&r1=1210783&r2=1210784&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java
 Tue Dec  6 05:18:56 2011
@@ -79,6 +79,9 @@ public abstract class AbstractMojo
      */
     private String outputDirectory;
 
+    /** @component */
+    private ArtifactContext artifactContext;
+
     public void contextualize(Context context) throws ContextException {
         container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
     }
@@ -149,8 +152,9 @@ public abstract class AbstractMojo
             }
         }
 
+        MavenProject project = getMavenProject();
         // TODO: should be configurable, but relies on it being passed into 
everywhere
-        File targetDir = PathUtil.getPrivateApplicationBaseDirectory( 
getMavenProject() );
+        File targetDir = PathUtil.getPrivateApplicationBaseDirectory( project 
);
 
         try
         {
@@ -162,10 +166,11 @@ public abstract class AbstractMojo
             vendorInfo.setFrameworkVersion( getFrameworkVersion() );
             vendorInfo.setVendorVersion( getVendorVersion() );
 
+            String localRepository = getLocalRepository();
+            artifactContext.init( project, 
project.getRemoteArtifactRepositories(), new File( localRepository ) );
             Artifact artifact = 
getNetExecutableFactory().getArtifactFor(getMojoGroupId(), getMojoArtifactId());
             resolveArtifact(artifact, targetDir );
-            getNetExecutableFactory().getPluginLoaderFor( artifact, vendorInfo,
-                                                          
getLocalRepository(), paramFile,
+            getNetExecutableFactory().getPluginLoaderFor( artifact, 
vendorInfo, localRepository, paramFile,
                                                           getClassName(), 
targetDir ).execute();
         }
         catch ( PlatformUnsupportedException e )


Reply via email to