mirror of https://github.com/apache/archiva.git
a little hackhish but fix use with tomcat maven plugin, sisu need a URLClassLoader as TCL to be able to use lookupList
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1158272 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5c5c959a14
commit
c7607a63e5
|
@ -19,13 +19,7 @@ package org.apache.archiva.consumers.lucene;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.File;
|
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
||||||
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
|
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
|
||||||
|
@ -49,6 +43,13 @@ import org.codehaus.plexus.taskqueue.TaskQueueException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Consumer for indexing the repository to provide search and IDE integration features.
|
* Consumer for indexing the repository to provide search and IDE integration features.
|
||||||
*/
|
*/
|
||||||
|
@ -77,14 +78,15 @@ public class NexusIndexerConsumer
|
||||||
private List<IndexCreator> allIndexCreators;
|
private List<IndexCreator> allIndexCreators;
|
||||||
|
|
||||||
public NexusIndexerConsumer( ArchivaTaskScheduler<ArtifactIndexingTask> scheduler,
|
public NexusIndexerConsumer( ArchivaTaskScheduler<ArtifactIndexingTask> scheduler,
|
||||||
ArchivaConfiguration configuration, FileTypes filetypes, PlexusSisuBridge plexusSisuBridge )
|
ArchivaConfiguration configuration, FileTypes filetypes,
|
||||||
|
PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
|
||||||
throws PlexusSisuBridgeException
|
throws PlexusSisuBridgeException
|
||||||
{
|
{
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
this.filetypes = filetypes;
|
this.filetypes = filetypes;
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
this.nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
this.nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
||||||
this.allIndexCreators = plexusSisuBridge.lookupList( IndexCreator.class );
|
this.allIndexCreators = mavenIndexerUtils.getAllIndexCreators();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
|
@ -126,14 +128,14 @@ public class NexusIndexerConsumer
|
||||||
public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
|
public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
|
||||||
throws ConsumerException
|
throws ConsumerException
|
||||||
{
|
{
|
||||||
if( executeOnEntireRepo )
|
if ( executeOnEntireRepo )
|
||||||
{
|
{
|
||||||
beginScan( repository, whenGathered );
|
beginScan( repository, whenGathered );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
managedRepository = new File( repository.getLocation() );
|
managedRepository = new File( repository.getLocation() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +160,7 @@ public class NexusIndexerConsumer
|
||||||
public void processFile( String path, boolean executeOnEntireRepo )
|
public void processFile( String path, boolean executeOnEntireRepo )
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
if( executeOnEntireRepo )
|
if ( executeOnEntireRepo )
|
||||||
{
|
{
|
||||||
processFile( path );
|
processFile( path );
|
||||||
}
|
}
|
||||||
|
@ -199,7 +201,7 @@ public class NexusIndexerConsumer
|
||||||
|
|
||||||
public void completeScan( boolean executeOnEntireRepo )
|
public void completeScan( boolean executeOnEntireRepo )
|
||||||
{
|
{
|
||||||
if( executeOnEntireRepo )
|
if ( executeOnEntireRepo )
|
||||||
{
|
{
|
||||||
completeScan();
|
completeScan();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<constructor-arg ref="archivaConfiguration"/>
|
<constructor-arg ref="archivaConfiguration"/>
|
||||||
<constructor-arg ref="fileTypes"/>
|
<constructor-arg ref="fileTypes"/>
|
||||||
<constructor-arg ref="plexusSisuBridge"/>
|
<constructor-arg ref="plexusSisuBridge"/>
|
||||||
|
<constructor-arg ref="mavenIndexerUtils"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="logger" class="org.apache.maven.archiva.common.utils.Slf4JPlexusLogger">
|
<bean id="logger" class="org.apache.maven.archiva.common.utils.Slf4JPlexusLogger">
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.archiva.indexer.search;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
||||||
import org.apache.archiva.indexer.util.SearchUtil;
|
import org.apache.archiva.indexer.util.SearchUtil;
|
||||||
|
@ -56,21 +57,23 @@ import java.util.Set;
|
||||||
public class NexusRepositorySearch
|
public class NexusRepositorySearch
|
||||||
implements RepositorySearch
|
implements RepositorySearch
|
||||||
{
|
{
|
||||||
private Logger log = LoggerFactory.getLogger( NexusRepositorySearch.class );
|
private Logger log = LoggerFactory.getLogger( getClass() );
|
||||||
|
|
||||||
private NexusIndexer indexer;
|
private NexusIndexer indexer;
|
||||||
|
|
||||||
private ArchivaConfiguration archivaConfig;
|
private ArchivaConfiguration archivaConfig;
|
||||||
|
|
||||||
private List<? extends IndexCreator> allIndexCreators;
|
private MavenIndexerUtils mavenIndexerUtils;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NexusRepositorySearch( PlexusSisuBridge plexusSisuBridge, ArchivaConfiguration archivaConfig )
|
public NexusRepositorySearch( PlexusSisuBridge plexusSisuBridge, ArchivaConfiguration archivaConfig,
|
||||||
|
MavenIndexerUtils mavenIndexerUtils )
|
||||||
throws PlexusSisuBridgeException
|
throws PlexusSisuBridgeException
|
||||||
{
|
{
|
||||||
this.indexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
this.indexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
||||||
this.archivaConfig = archivaConfig;
|
this.archivaConfig = archivaConfig;
|
||||||
allIndexCreators = plexusSisuBridge.lookupList( IndexCreator.class );
|
this.mavenIndexerUtils = mavenIndexerUtils;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -299,9 +302,9 @@ public class NexusRepositorySearch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected List<? extends IndexCreator> getAllIndexCreators()
|
protected List<IndexCreator> getAllIndexCreators()
|
||||||
{
|
{
|
||||||
return allIndexCreators;
|
return mavenIndexerUtils.getAllIndexCreators();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -199,4 +199,14 @@ public class SearchFields
|
||||||
{
|
{
|
||||||
this.bundleExportService = bundleExportService;
|
this.bundleExportService = bundleExportService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "SearchFields{" + "groupId='" + groupId + '\'' + ", artifactId='" + artifactId + '\'' + ", version='"
|
||||||
|
+ version + '\'' + ", packaging='" + packaging + '\'' + ", className='" + className + '\''
|
||||||
|
+ ", repositories=" + repositories + ", bundleVersion='" + bundleVersion + '\'' + ", bundleSymbolicName='"
|
||||||
|
+ bundleSymbolicName + '\'' + ", bundleExportPackage='" + bundleExportPackage + '\''
|
||||||
|
+ ", bundleExportService='" + bundleExportService + '\'' + '}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,5 +49,9 @@
|
||||||
<groupId>javax.annotation</groupId>
|
<groupId>javax.annotation</groupId>
|
||||||
<artifactId>jsr250-api</artifactId>
|
<artifactId>jsr250-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.indexer</groupId>
|
||||||
|
<artifactId>indexer-core</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
package org.apache.archiva.common.plexusbridge;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.index.context.IndexCreator;
|
||||||
|
import org.apache.maven.index.creator.JarFileContentsIndexCreator;
|
||||||
|
import org.apache.maven.index.creator.MavenArchetypeArtifactInfoIndexCreator;
|
||||||
|
import org.apache.maven.index.creator.MavenPluginArtifactInfoIndexCreator;
|
||||||
|
import org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator;
|
||||||
|
import org.apache.maven.index.creator.OSGIArtifactIndexCreator;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Olivier Lamy
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
@Service("mavenIndexerUtils")
|
||||||
|
public class MavenIndexerUtils
|
||||||
|
{
|
||||||
|
|
||||||
|
private Logger log = LoggerFactory.getLogger( getClass() );
|
||||||
|
|
||||||
|
private List<? extends IndexCreator> allIndexCreators;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public MavenIndexerUtils( PlexusSisuBridge plexusSisuBridge )
|
||||||
|
throws PlexusSisuBridgeException
|
||||||
|
{
|
||||||
|
allIndexCreators = new ArrayList( plexusSisuBridge.lookupList( IndexCreator.class ) );
|
||||||
|
|
||||||
|
if ( allIndexCreators == null || allIndexCreators.isEmpty() )
|
||||||
|
{
|
||||||
|
// olamy when the TCL is not a URLClassLoader lookupList fail !
|
||||||
|
// when using tomcat maven plugin so adding a simple hack
|
||||||
|
log.warn( "using lookList from sisu plexus failed so build indexCreator manually" );
|
||||||
|
|
||||||
|
allIndexCreators =
|
||||||
|
Arrays.asList( new OSGIArtifactIndexCreator(), new MavenArchetypeArtifactInfoIndexCreator(),
|
||||||
|
new MinimalArtifactInfoIndexCreator(), new JarFileContentsIndexCreator(),
|
||||||
|
new MavenPluginArtifactInfoIndexCreator() );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
log.debug( "allIndexCreators {}", allIndexCreators );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<? extends IndexCreator> getAllIndexCreators()
|
||||||
|
{
|
||||||
|
return allIndexCreators;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllIndexCreators( List<IndexCreator> allIndexCreators )
|
||||||
|
{
|
||||||
|
this.allIndexCreators = allIndexCreators;
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,6 +25,12 @@ package org.apache.archiva.common.plexusbridge;
|
||||||
public class PlexusSisuBridgeException
|
public class PlexusSisuBridgeException
|
||||||
extends Exception
|
extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public PlexusSisuBridgeException( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
|
|
||||||
public PlexusSisuBridgeException( String message, Throwable throwable )
|
public PlexusSisuBridgeException( String message, Throwable throwable )
|
||||||
{
|
{
|
||||||
super( message, throwable );
|
super( message, throwable );
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.archiva.scheduler.indexing;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
|
||||||
import org.apache.lucene.search.BooleanClause;
|
import org.apache.lucene.search.BooleanClause;
|
||||||
|
@ -75,6 +76,9 @@ public class ArchivaIndexingTaskExecutor
|
||||||
@Inject
|
@Inject
|
||||||
private PlexusSisuBridge plexusSisuBridge;
|
private PlexusSisuBridge plexusSisuBridge;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private MavenIndexerUtils mavenIndexerUtils;
|
||||||
|
|
||||||
private NexusIndexer nexusIndexer;
|
private NexusIndexer nexusIndexer;
|
||||||
|
|
||||||
private List<IndexCreator> allIndexCreators;
|
private List<IndexCreator> allIndexCreators;
|
||||||
|
@ -91,7 +95,7 @@ public class ArchivaIndexingTaskExecutor
|
||||||
|
|
||||||
nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
||||||
|
|
||||||
allIndexCreators = plexusSisuBridge.lookupList( IndexCreator.class );
|
allIndexCreators = mavenIndexerUtils.getAllIndexCreators();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeTask( Task task )
|
public void executeTask( Task task )
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class ArtifactIndexingTask
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IndexingContext createContext( ManagedRepositoryConfiguration repository, NexusIndexer indexer,
|
public static IndexingContext createContext( ManagedRepositoryConfiguration repository, NexusIndexer indexer,
|
||||||
List<IndexCreator> indexCreators )
|
List<? extends IndexCreator> indexCreators )
|
||||||
throws IOException, UnsupportedExistingLuceneIndexException
|
throws IOException, UnsupportedExistingLuceneIndexException
|
||||||
{
|
{
|
||||||
String indexDir = repository.getIndexDir();
|
String indexDir = repository.getIndexDir();
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.indexing;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
|
||||||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.lucene.search.BooleanClause.Occur;
|
import org.apache.lucene.search.BooleanClause.Occur;
|
||||||
|
@ -33,7 +34,6 @@ import org.apache.maven.index.FlatSearchRequest;
|
||||||
import org.apache.maven.index.FlatSearchResponse;
|
import org.apache.maven.index.FlatSearchResponse;
|
||||||
import org.apache.maven.index.MAVEN;
|
import org.apache.maven.index.MAVEN;
|
||||||
import org.apache.maven.index.NexusIndexer;
|
import org.apache.maven.index.NexusIndexer;
|
||||||
import org.apache.maven.index.context.IndexCreator;
|
|
||||||
import org.apache.maven.index.context.IndexingContext;
|
import org.apache.maven.index.context.IndexingContext;
|
||||||
import org.apache.maven.index.expr.SourcedSearchExpression;
|
import org.apache.maven.index.expr.SourcedSearchExpression;
|
||||||
import org.apache.maven.index.expr.StringSearchExpression;
|
import org.apache.maven.index.expr.StringSearchExpression;
|
||||||
|
@ -76,6 +76,9 @@ public class ArchivaIndexingTaskExecutorTest
|
||||||
@Inject
|
@Inject
|
||||||
PlexusSisuBridge plexusSisuBridge;
|
PlexusSisuBridge plexusSisuBridge;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
MavenIndexerUtils mavenIndexerUtils;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp()
|
public void setUp()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
@ -96,8 +99,7 @@ public class ArchivaIndexingTaskExecutorTest
|
||||||
|
|
||||||
indexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
indexer = plexusSisuBridge.lookup( NexusIndexer.class );
|
||||||
|
|
||||||
ArtifactIndexingTask.createContext( repositoryConfig, indexer,
|
ArtifactIndexingTask.createContext( repositoryConfig, indexer, mavenIndexerUtils.getAllIndexCreators() );
|
||||||
plexusSisuBridge.lookupList( IndexCreator.class ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
@ -153,7 +155,7 @@ public class ArchivaIndexingTaskExecutorTest
|
||||||
new File( repositoryConfig.getLocation() ),
|
new File( repositoryConfig.getLocation() ),
|
||||||
new File( repositoryConfig.getLocation(),
|
new File( repositoryConfig.getLocation(),
|
||||||
".indexer" ), null, null,
|
".indexer" ), null, null,
|
||||||
plexusSisuBridge.lookupList( IndexCreator.class ) );
|
mavenIndexerUtils.getAllIndexCreators() );
|
||||||
context.setSearchable( true );
|
context.setSearchable( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search all indexed fields by the given criteria.
|
* Search all indexed fields by the given criteria.
|
||||||
*
|
* <p/>
|
||||||
* plexus.component role="com.opensymphony.xwork2.Action" role-hint="searchAction" instantiation-strategy="per-lookup"
|
* plexus.component role="com.opensymphony.xwork2.Action" role-hint="searchAction" instantiation-strategy="per-lookup"
|
||||||
*/
|
*/
|
||||||
@Controller( "searchAction" )
|
@Controller( "searchAction" )
|
||||||
|
@ -170,8 +170,8 @@ public class SearchAction
|
||||||
public String filteredSearch()
|
public String filteredSearch()
|
||||||
throws MalformedURLException
|
throws MalformedURLException
|
||||||
{
|
{
|
||||||
if ( ( groupId == null || "".equals( groupId ) ) && ( artifactId == null || "".equals( artifactId ) ) &&
|
if ( ( groupId == null || "".equals( groupId ) ) && ( artifactId == null || "".equals( artifactId ) )
|
||||||
( className == null || "".equals( className ) ) && ( version == null || "".equals( version ) ) )
|
&& ( className == null || "".equals( className ) ) && ( version == null || "".equals( version ) ) )
|
||||||
{
|
{
|
||||||
addActionError( "Advanced Search - At least one search criteria must be provided." );
|
addActionError( "Advanced Search - At least one search criteria must be provided." );
|
||||||
return INPUT;
|
return INPUT;
|
||||||
|
@ -188,8 +188,8 @@ public class SearchAction
|
||||||
limits.setPageSize( rowCount );
|
limits.setPageSize( rowCount );
|
||||||
List<String> selectedRepos = new ArrayList<String>();
|
List<String> selectedRepos = new ArrayList<String>();
|
||||||
|
|
||||||
if ( repositoryId == null || StringUtils.isBlank( repositoryId ) || "all".equals( StringUtils.stripToEmpty(
|
if ( repositoryId == null || StringUtils.isBlank( repositoryId ) || "all".equals(
|
||||||
repositoryId ) ) )
|
StringUtils.stripToEmpty( repositoryId ) ) )
|
||||||
{
|
{
|
||||||
selectedRepos = getObservableRepos();
|
selectedRepos = getObservableRepos();
|
||||||
}
|
}
|
||||||
|
@ -205,6 +205,8 @@ public class SearchAction
|
||||||
|
|
||||||
SearchFields searchFields = new SearchFields( groupId, artifactId, version, null, className, selectedRepos );
|
SearchFields searchFields = new SearchFields( groupId, artifactId, version, null, className, selectedRepos );
|
||||||
|
|
||||||
|
log.debug( "filteredSearch with searchFields {}", searchFields );
|
||||||
|
|
||||||
// TODO: add packaging in the list of fields for advanced search (UI)?
|
// TODO: add packaging in the list of fields for advanced search (UI)?
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -263,12 +265,14 @@ public class SearchAction
|
||||||
return GlobalResults.ACCESS_TO_NO_REPOS;
|
return GlobalResults.ACCESS_TO_NO_REPOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.debug( "quickSearch with selectedRepos {} query {}", selectedRepos, q );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( searchResultsOnly && !completeQueryString.equals( "" ) )
|
if ( searchResultsOnly && !completeQueryString.equals( "" ) )
|
||||||
{
|
{
|
||||||
results = getNexusSearch().search( getPrincipal(), selectedRepos, q, limits,
|
results =
|
||||||
parseCompleteQueryString() );
|
getNexusSearch().search( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -552,8 +556,8 @@ public class SearchAction
|
||||||
{
|
{
|
||||||
if ( nexusSearch == null )
|
if ( nexusSearch == null )
|
||||||
{
|
{
|
||||||
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(
|
WebApplicationContext wac =
|
||||||
ServletActionContext.getServletContext() );
|
WebApplicationContextUtils.getRequiredWebApplicationContext( ServletActionContext.getServletContext() );
|
||||||
nexusSearch = wac.getBean( "nexusSearch", RepositorySearch.class );
|
nexusSearch = wac.getBean( "nexusSearch", RepositorySearch.class );
|
||||||
}
|
}
|
||||||
return nexusSearch;
|
return nexusSearch;
|
||||||
|
|
|
@ -27,7 +27,10 @@
|
||||||
<param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
|
<param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
<logger name="com.opensymphony.xwork2.interceptor.ParametersInterceptor">
|
<logger name="org.apache.maven.archiva.web.action.SearchAction">
|
||||||
|
<level value="debug"/>
|
||||||
|
</logger>
|
||||||
|
<logger name="org.apache.archiva.indexer.search.NexusRepositorySearch">
|
||||||
<level value="debug"/>
|
<level value="debug"/>
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="org.apache.commons.configuration.DefaultConfigurationBuilder">
|
<logger name="org.apache.commons.configuration.DefaultConfigurationBuilder">
|
||||||
|
|
Loading…
Reference in New Issue