Author: meerajk
Date: Wed Sep 20 14:23:57 2006
New Revision: 448350

URL: http://svn.apache.org/viewvc?view=rev&rev=448350
Log:
Added runtime info to the constructor.

Modified:
    
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
    
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
    
incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java

Modified: 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java?view=diff&rev=448350&r1=448349&r2=448350
==============================================================================
--- 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
 (original)
+++ 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
 Wed Sep 20 14:23:57 2006
@@ -20,9 +20,12 @@
 
 import java.util.Collection;
 
+import org.apache.maven.plugin.registry.RuntimeInfo;
+import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.services.artifact.Artifact;
 import org.apache.tuscany.spi.services.artifact.ArtifactRepository;
 import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Property;
 
 /**
  * Artifact repository used for resolving artifacts.
@@ -34,24 +37,26 @@
  * @version $Rev$ $Date$
  */
 public class MavenArtifactRepository implements ArtifactRepository {
-    
+
     /** Maven helper */
     private MavenHelper mavenHelper;
 
     /**
      * Conctructs a new artifact repository.
      */
-    public MavenArtifactRepository(String[] remoteRepoUrls) {
-        mavenHelper = new MavenHelper(remoteRepoUrls);
+    public MavenArtifactRepository(@Property(name = "remoteRepoUrls")
+    String[] remoteRepoUrls, @Autowire
+    RuntimeInfo runtimeInfo) {
+        mavenHelper = new MavenHelper(remoteRepoUrls, runtimeInfo);
         mavenHelper.start();
     }
 
     /**
-     * Resolve an artifact.
-     * This ensures that the information associated with an artifact is fully 
populated;
-     * Specifically, after this operation the URL should contain a location 
where the artifact can be obtained.
-     *
-     * @param artifact the artifact to be resolved
+     * Resolve an artifact. This ensures that the information associated with 
an artifact is fully populated; Specifically, after this operation the
+     * URL should contain a location where the artifact can be obtained.
+     * 
+     * @param artifact
+     *            the artifact to be resolved
      */
     public void resolve(Artifact rootArtifact) {
         mavenHelper.resolveTransitively(rootArtifact);
@@ -59,8 +64,9 @@
 
     /**
      * Resolve a collection of Artifacts.
-     *
-     * @param artifacts a collection of artifacts to be resolved
+     * 
+     * @param artifacts
+     *            a collection of artifacts to be resolved
      * @see #resolve(Artifact)
      */
     public void resolve(Collection<? extends Artifact> artifacts) {
@@ -68,10 +74,10 @@
             resolve(artifact);
         }
     }
-    
+
     /**
      * Destroy method.
-     *
+     * 
      */
     @Destroy
     public void destroy() {

Modified: 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java?view=diff&rev=448350&r1=448349&r2=448350
==============================================================================
--- 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
 (original)
+++ 
incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
 Wed Sep 20 14:23:57 2006
@@ -36,6 +36,7 @@
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugin.registry.RuntimeInfo;
 import org.apache.tuscany.spi.services.artifact.Artifact;
 import org.codehaus.classworlds.ClassWorld;
 import org.codehaus.classworlds.DuplicateRealmException;
@@ -76,8 +77,9 @@
      * 
      * @param remoteRepositoryUrls
      *            Remote repository URLS.
+     * @param runtimeInfo Runtime information.
      */
-    public MavenHelper(String[] remoteRepositoryUrls) {
+    public MavenHelper(String[] remoteRepositoryUrls, RuntimeInfo runtimeInfo) 
{
         this.remoteRepositoryUrls = remoteRepositoryUrls;
     }
 

Modified: 
incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java?view=diff&rev=448350&r1=448349&r2=448350
==============================================================================
--- 
incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
 (original)
+++ 
incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
 Wed Sep 20 14:23:57 2006
@@ -50,7 +50,7 @@
     public void testResolveArtifact() {
         
         String[] remoteRepoUrls = {"http://repo1.maven.org/maven2/"};
-        MavenArtifactRepository repository = new 
MavenArtifactRepository(remoteRepoUrls);
+        MavenArtifactRepository repository = new 
MavenArtifactRepository(remoteRepoUrls, null);
         Artifact artifact = new Artifact();
         artifact.setGroup("org.apache.maven");
         artifact.setName("maven-artifact");



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to