2012-02-06 124 views
1

我已經下載了Apache Tika源文件夾,並且已經安裝了Maven。然後,通過命令行(MVN安裝)我已經安裝了提卡:如何將org.apache.tika源碼整合到我的項目中?

[INFO] Reactor Summary: 
[INFO] ------------------------------------------------------------------------ 
[INFO] Apache Tika parent .................................... SUCCESS [4:20.656s] 
[INFO] Apache Tika core ...................................... SUCCESS [2:26.466s] 
[INFO] Apache Tika parsers ................................... SUCCESS [3:27.711s] 
[INFO] Apache Tika application ............................... SUCCESS [1:23.548s] 
[INFO] Apache Tika OSGi bundle ............................... SUCCESS [3:34.223s] 
[INFO] Apache Tika ........................................... SUCCESS [6.217s] 
[INFO] ------------------------------------------------------------------------ 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESSFUL 

但現在我不知道什麼是我的項目中使用蒂卡下一步。其實我不知道如何在我的項目中添加Tika。

我之所以用Tika來代替jar文件是因爲我想將farsi.ngp文件添加到Tika的languageIdentification中。我已經添加farsi.ngp並通過Maven構建Tika,但現在我不知道下一步是什麼。我真的必須添加到我的項目中?

+0

包括它作爲依賴項。但是用一些標識它爲非標準構建的東西加以標記。更好的是,向Tika提交補丁,以便將其包含在發佈中。 – 2012-02-06 15:27:44

回答

2

我讀this頁,下面是我的建議:

您修改後的代碼或添加的.ngp文件並生成代碼,你必須讓這些文物建立:

tika-core/target/tika-core-1.0.jar 
tika-parsers/target/tika-parsers-1.0.jar 

只要在您的應用程序中,您希望使用tika,將2個tika罐子和其相關的罐子加入到classpath中。例如,如果您在應用程序中使用ant,請將其添加到構建文件中:

<classpath> 
    ... <!-- your other classpath entries --> 
    <pathelement location="path/to/tika-core-1.0.jar"/> 
    <pathelement location="path/to/tika-parsers-1.0.jar"/> 
    <pathelement location="path/to/commons-logging-1.1.1.jar"/> 
    <pathelement location="path/to/commons-compress-1.0.jar"/> 
    <pathelement location="path/to/pdfbox-1.0.0-incubating.jar"/> 
    <pathelement location="path/to/fontbox-1.0.0-incubator.jar"/> 
    <pathelement location="path/to/jempbox-1.0.0-incubator.jar"/> 
    <pathelement location="path/to/poi-3.6.jar"/> 
    <pathelement location="path/to/poi-scratchpad-3.6.jar"/> 
    <pathelement location="path/to/poi-ooxml-3.6.jar"/> 
    <pathelement location="path/to/poi-ooxml-schemas-3.6.jar"/> 
    <pathelement location="path/to/xmlbeans-2.3.0.jar"/> 
    <pathelement location="path/to/dom4j-1.6.1.jar"/> 
    <pathelement location="path/to/xml-apis-1.0.b2.jar"/> 
    <pathelement location="path/to/geronimo-stax-api_1.0_spec-1.0.jar"/> 
    <pathelement location="path/to/tagsoup-1.2.jar"/> 
    <pathelement location="path/to/asm-3.1.jar"/> 
    <pathelement location="path/to/log4j-1.2.14.jar"/> 
    <pathelement location="path/to/metadata-extractor-2.4.0-beta-1.jar"/> 
</classpath> 

希望這對您有所幫助。

+0

謝謝。它有幫助 – aliakbarian 2012-02-07 05:52:44

相關問題