diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
index 7c14c38fc..eb8aa0519 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
@@ -63,10 +63,10 @@
org.apache.archiva.web.xmlrpc.client.SampleClient
- http://127.0.0.1:9091/xmlrpc
+ http://127.0.0.1:8080/archiva/xmlrpc
admin
${password}
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImpl.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImpl.java
index b0654dfbb..9cd26bd18 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImpl.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImpl.java
@@ -40,6 +40,8 @@ import org.apache.maven.archiva.database.browsing.RepositoryBrowsing;
import org.apache.maven.archiva.database.constraints.ArtifactsByChecksumConstraint;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* SearchServiceImpl
@@ -49,6 +51,8 @@ import org.apache.maven.archiva.model.ArchivaProjectModel;
public class SearchServiceImpl
implements SearchService
{
+ private Logger log = LoggerFactory.getLogger( SearchServiceImpl.class );
+
private RepositorySearch search;
private XmlRpcUserRepositories xmlRpcUserRepositories;
@@ -89,35 +93,43 @@ public class SearchServiceImpl
SearchResults results = null;
results = search.search( "", observableRepos, queryString, limits, null );
-
+
List hits = results.getHits();
+
for( SearchResultHit hit : hits )
{
ArtifactDAO artifactDAO = archivaDAO.getArtifactDAO();
- try
+
+ List versions = hit.getVersions();
+ if( versions != null )
{
- ArchivaArtifact pomArtifact = artifactDAO.getArtifact(
- hit.getGroupId(), hit.getArtifactId(), hit.getVersion(), "", "pom", hit.getRepositoryId() );
-
- if( pomArtifact != null )
- {
- Artifact artifact = new Artifact( pomArtifact.getModel().getRepositoryId(), pomArtifact.getGroupId(), pomArtifact.getArtifactId(), pomArtifact.getVersion(),
- pomArtifact.getType() );
- //pomArtifact.getType(), pomArtifact.getModel().getWhenGathered() );
- artifacts.add( artifact );
+ for( String version : versions )
+ {
+ for( String repo : observableRepos )
+ {
+ try
+ {
+ ArchivaArtifact pomArtifact = artifactDAO.getArtifact(
+ hit.getGroupId(), hit.getArtifactId(), version, null, "pom", repo );
+ if( pomArtifact != null )
+ {
+ Artifact artifact = new Artifact( pomArtifact.getModel().getRepositoryId(), pomArtifact.getGroupId(), pomArtifact.getArtifactId(), pomArtifact.getVersion(),
+ pomArtifact.getType() );
+ //pomArtifact.getType(), pomArtifact.getModel().getWhenGathered() );
+ artifacts.add( artifact );
+ break;
+ }
+ }
+ catch( ObjectNotFoundException e )
+ {
+ log.debug( "Unable to find pom artifact : " + e.getMessage() );
+ }
+ catch( ArchivaDatabaseException e )
+ {
+ log.debug( "Error occurred while getting pom artifact from database : " + e.getMessage() );
+ }
+ }
}
- else
- {
- continue;
- }
- }
- catch ( ObjectNotFoundException e )
- {
- continue;
- }
- catch ( ArchivaDatabaseException e )
- {
- continue;
}
}