本文整理匯總了Java中org.apache.maven.index.Scanner類的典型用法代碼示例。如果您正苦於以下問題:Java Scanner類的具體用法?Java Scanner怎麽用?Java Scanner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Scanner類屬於org.apache.maven.index包,在下文中一共展示了Scanner類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initIndexer
import org.apache.maven.index.Scanner; //導入依賴的package包/類
private void initIndexer () {
if (!inited) {
try {
ContainerConfiguration config = new DefaultContainerConfiguration();
//#154755 - start
ClassWorld world = new ClassWorld();
ClassRealm embedderRealm = world.newRealm("maven.embedder", MavenEmbedder.class.getClassLoader()); //NOI18N
ClassLoader indexerLoader = NexusRepositoryIndexerImpl.class.getClassLoader();
ClassRealm indexerRealm = world.newRealm("maven.indexer", indexerLoader); //NOI18N
ClassRealm plexusRealm = world.newRealm("plexus.core", indexerLoader); //NOI18N
//need to import META-INF/plexus stuff, otherwise the items in META-INF will not be loaded,
// and the Dependency Injection won't work.
plexusRealm.importFrom(embedderRealm.getId(), "META-INF/plexus"); //NOI18N
plexusRealm.importFrom(embedderRealm.getId(), "META-INF/maven"); //NOI18N
plexusRealm.importFrom(indexerRealm.getId(), "META-INF/plexus"); //NOI18N
plexusRealm.importFrom(indexerRealm.getId(), "META-INF/maven"); //NOI18N
config.setClassWorld(world);
config.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
//#154755 - end
embedder = new DefaultPlexusContainer(config);
ComponentDescriptor<ArtifactContextProducer> desc = new ComponentDescriptor<ArtifactContextProducer>();
desc.setRoleClass(ArtifactContextProducer.class);
desc.setImplementationClass(CustomArtifactContextProducer.class);
ComponentRequirement req = new ComponentRequirement(); // XXX why is this not automatic?
req.setFieldName("mapper");
req.setRole(ArtifactPackagingMapper.class.getName());
desc.addRequirement(req);
embedder.addComponentDescriptor(desc);
indexer = embedder.lookup(Indexer.class);
scanner = embedder.lookup(org.apache.maven.index.Scanner.class);
searcher = embedder.lookup(SearchEngine.class);
remoteIndexUpdater = embedder.lookup(IndexUpdater.class);
contextProducer = embedder.lookup(ArtifactContextProducer.class);
inited = true;
} catch (Exception x) {
Exceptions.printStackTrace(x);
}
}
}