maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r734304 - in /maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus: DefaultPlexusMercury.java PlexusMercury.java
Date Wed, 14 Jan 2009 02:16:48 GMT
Author: ogusakov
Date: Tue Jan 13 18:16:47 2009
New Revision: 734304

URL: http://svn.apache.org/viewvc?rev=734304&view=rev
Log:
[MNG-3981] added new call to PlexusMercury

Modified:
    maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
    maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java?rev=734304&r1=734303&r2=734304&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
Tue Jan 13 18:16:47 2009
@@ -48,6 +48,7 @@
 import org.apache.maven.mercury.metadata.DependencyBuilderFactory;
 import org.apache.maven.mercury.metadata.MetadataTreeException;
 import org.apache.maven.mercury.metadata.MetadataTreeNode;
+import org.apache.maven.mercury.repository.api.ArtifactBasicResults;
 import org.apache.maven.mercury.repository.api.ArtifactResults;
 import org.apache.maven.mercury.repository.api.Repository;
 import org.apache.maven.mercury.repository.api.RepositoryException;
@@ -318,5 +319,30 @@
     }
   }
   //---------------------------------------------------------------
+  /**
+   * get all available versions of for the artifact query.
+   * 
+   * @param repo repository instance to search
+   * @param query metadata query to search by
+   * @return list of found version metadatas
+   * @throws PlexusMercuryException
+   */
+  public List<ArtifactBasicMetadata> readVersions( List<Repository> repos
+                                                   , ArtifactBasicMetadata query
+                                                  )
+  throws RepositoryException
+  {
+      VirtualRepositoryReader vr = new VirtualRepositoryReader( repos );
+      List<ArtifactBasicMetadata> q = new ArrayList<ArtifactBasicMetadata>(1);
+      q.add( query );
+      
+      ArtifactBasicResults res = vr.readVersions( q );
+
+      if( res.hasExceptions() )
+          throw new RepositoryException( res.getExceptions().toString() );
+
+      return res.getResult( query );
+  }
+  //---------------------------------------------------------------
   //---------------------------------------------------------------
 }

Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java?rev=734304&r1=734303&r2=734304&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
(original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
Tue Jan 13 18:16:47 2009
@@ -203,4 +203,16 @@
   public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum
scope, ArtifactMetadata metadata )
   throws RepositoryException;  
   
+  /**
+   * get all available versions of for the artifact query.
+   * 
+   * @param repo repository instance to search
+   * @param query metadata query to search by
+   * @return list of found version metadatas
+   * @throws PlexusMercuryException
+   */
+  public List<ArtifactBasicMetadata> readVersions( List<Repository> repos
+                                                   , ArtifactBasicMetadata query
+                                                  )
+  throws RepositoryException;
 }



Mime
View raw message