如何将 Tika 集成到我的 Lucene 项目中?

发布于 2024-12-03 03:55:55 字数 1005 浏览 3 评论 0原文

我想将 Apache Tika 集成到我的 java 项目中。我需要从不同的文件格式(excel、doc、ppt 等)获取文本 经过一番阅读后,我了解到构建 tika 的唯一方法是下载 src 文件并使用 Maven 构建它。我在 Tika src (apache-tika-0.9-src) 的根目录中执行“mvn install”,但出现此错误:

[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.apache.tika:tika:0.9 (C:\Users\vexler\Documents\Instal
ls\apache-tika-0.9-src\apache-tika-0.9\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.apache.tika:tika-parent:0.9: Could
 not transfer artifact org.apache:apache:pom:6 from/to central (http://repo1.mav
en.org/maven2): Error transferring file: Connection timed out: connect and 'pare
nt.relativePath' points at no local POM @ org.apache.tika:tika-parent:0.9, C:\Us
ers\vexler\Documents\Installs\apache-tika-0.9-src\apache-tika-0.9\tika-parent\po
m.xml, line 25, column 11 -> [Help 2]

我非常感谢有关此错误的任何帮助。 谢谢 :-) 罗伊特

I want to integrate Apache Tika in my java project. I need to get text from different file formats (excel, doc, ppt, and more..)
After some reading I understand that the only way to build tika is by downloading the src file and build it with Maven. I execute "mvn install" in the root directory of Tika src (apache-tika-0.9-src) , but i get this error:

[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.apache.tika:tika:0.9 (C:\Users\vexler\Documents\Instal
ls\apache-tika-0.9-src\apache-tika-0.9\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.apache.tika:tika-parent:0.9: Could
 not transfer artifact org.apache:apache:pom:6 from/to central (http://repo1.mav
en.org/maven2): Error transferring file: Connection timed out: connect and 'pare
nt.relativePath' points at no local POM @ org.apache.tika:tika-parent:0.9, C:\Us
ers\vexler\Documents\Installs\apache-tika-0.9-src\apache-tika-0.9\tika-parent\po
m.xml, line 25, column 11 -> [Help 2]

I really appriciate any help with this error.
Thanks :-)
Reuth

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呢古 2024-12-10 03:55:55

假设您在项目中使用 Maven,那么生活会简单得多

只需添加类似的内容

<dependency>
   <groupId>org.apache.tika</groupId>
   <artifactId>tika-parsers</artifactId>
   <version>0.9</version>
   <scope>provided</scope>
 </dependency>

然后 Maven 将为您下载 Tika 及其依赖项

或者,如果您下载最新的 Tika OSGi Bundle Jar (例如 0.9)并解压它,然后你将获得 Tika 依赖项和代码

Assuming you're using Maven in your project, then life is much much simpler

Just add something like

<dependency>
   <groupId>org.apache.tika</groupId>
   <artifactId>tika-parsers</artifactId>
   <version>0.9</version>
   <scope>provided</scope>
 </dependency>

And Maven will then download Tika and it's dependencies for you

Alternately, if you download the latest Tika OSGi Bundle Jar (eg 0.9) and unpack that, then you'll get the Tika dependencies and code in that

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文