diff options
author | Olivier Lamy <olamy@apache.org> | 2013-09-24 13:31:10 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-09-24 13:31:10 +0000 |
commit | ef1759b856de7ba5d31dc3fcc92fcea4516e5e28 (patch) | |
tree | 1bd15dd0ae09907c8cd39ef04784b568f7e0da64 /archiva-modules | |
parent | 5a63e2b407a24de3831d47c18d4e71449222040b (diff) | |
download | archiva-ef1759b856de7ba5d31dc3fcc92fcea4516e5e28.tar.gz archiva-ef1759b856de7ba5d31dc3fcc92fcea4516e5e28.zip |
[MRM-1779] pom artifacts cannot be searched on Archiva 1.4-M4
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1525882 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
5 files changed, 21 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 3ec7502e1..554208cc3 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -123,7 +123,7 @@ public class MavenRepositorySearch // we retun only artifacts without classifier in quick search, olamy cannot find a way to say with this field empty // FIXME cannot find a way currently to setup this in constructQuery !!! - return search( limits, q, indexingContextIds, NoClassifierArtifactInfoFilter.LIST, selectedRepos, false ); + return search( limits, q, indexingContextIds, NoClassifierArtifactInfoFilter.LIST, selectedRepos, true ); } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java index c35958aed..ef81635f5 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java @@ -208,6 +208,13 @@ public abstract class AbstractMavenRepositorySearch { assertTrue( "file not exists " + artifactFile.getPath(), artifactFile.exists() ); ArtifactContext ac = artifactContextProducer.getArtifactContext( context, artifactFile ); + + if ( artifactFile.getPath().endsWith( ".pom" ) ) + { + ac.getArtifactInfo().fextension = "pom"; + ac.getArtifactInfo().packaging = "pom"; + ac.getArtifactInfo().classifier = "pom"; + } nexusIndexer.addArtifactToIndex( ac, context ); context.updateTimestamp( true ); } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java index 344a39c2e..87b4ff1ca 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java @@ -85,6 +85,10 @@ public class MavenRepositorySearchTest files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); + + files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom" ) ); + files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jar" ) ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 699d3f76f..3fc0981e9 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -160,6 +160,14 @@ public class ArchivaIndexingTaskExecutor if ( ac != null ) { + // MRM-1779 pom must be indexed too + // TODO make that configurable? + if ( artifactFile.getPath().endsWith( ".pom" ) ) + { + ac.getArtifactInfo().fextension = "pom"; + ac.getArtifactInfo().packaging = "pom"; + ac.getArtifactInfo().classifier = "pom"; + } if ( indexingTask.getAction().equals( ArtifactIndexingTask.Action.ADD ) ) { //IndexSearcher s = context.getIndexSearcher(); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js index f920e2d8f..9e03ae75b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js @@ -1951,7 +1951,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno this.classifier=ko.observable(); //private boolean includePomArtifacts = false; - this.includePomArtifacts=ko.observable(false); + this.includePomArtifacts=ko.observable(true); this.classifier=ko.observable(); } |