|
54 | 54 | import org.apache.tika.pipes.core.PipesParser; |
55 | 55 | import org.apache.tika.pipes.core.config.ConfigStore; |
56 | 56 | import org.apache.tika.pipes.core.config.ConfigStoreFactory; |
| 57 | +import org.apache.tika.pipes.core.config.DefaultPluginsDir; |
57 | 58 | import org.apache.tika.pipes.core.fetcher.FetcherManager; |
58 | 59 | import org.apache.tika.pipes.grpc.proto.DeleteFetcherReply; |
59 | 60 | import org.apache.tika.pipes.grpc.proto.DeleteFetcherRequest; |
@@ -135,8 +136,20 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase { |
135 | 136 | pluginManager.loadPlugins(); |
136 | 137 | pluginManager.startPlugins(); |
137 | 138 | } catch (TikaConfigException e) { |
138 | | - LOG.warn("Could not load plugin manager, using default: {}", e.getMessage()); |
139 | | - pluginManager = new org.pf4j.DefaultPluginManager(); |
| 139 | + // plugin-roots not configured: probe the install layout like the |
| 140 | + // other pipes entry points (TIKA-4864/TIKA-4865) |
| 141 | + String defaultRoot = DefaultPluginsDir.resolve(TikaGrpcServerImpl.class); |
| 142 | + LOG.warn("plugin-roots not configured ({}); falling back to {}", |
| 143 | + e.getMessage(), defaultRoot); |
| 144 | + try { |
| 145 | + pluginManager = TikaPluginManager.loadFromPaths(defaultRoot); |
| 146 | + pluginManager.loadPlugins(); |
| 147 | + pluginManager.startPlugins(); |
| 148 | + } catch (TikaConfigException | IOException e2) { |
| 149 | + LOG.warn("could not load plugins from {}, starting with none: {}", |
| 150 | + defaultRoot, e2.getMessage()); |
| 151 | + pluginManager = new org.pf4j.DefaultPluginManager(); |
| 152 | + } |
140 | 153 | } |
141 | 154 |
|
142 | 155 | if (pluginManager.getPlugins().isEmpty()) { |
|
0 commit comments