Giter Club home page Giter Club logo

Comments (6)

dadoonet avatar dadoonet commented on June 8, 2024

In fact, tika-app is included but some transitives dependencies are excluded:

  • tika-parsers
  • tika-xmp
  • slf4j-log4j12
  • gson

But as you wrote, tika-app.jar contains too much libraries and we can not exclude it with Maven.

Here is the dependency tree before change proposal:

[INFO] org.elasticsearch:elasticsearch-mapper-attachments:jar:1.6.0-SNAPSHOT
[INFO] +- org.elasticsearch:elasticsearch:jar:0.19.0:compile
[INFO] |  +- org.apache.lucene:lucene-core:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-analyzers:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-queries:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-memory:jar:3.5.0:compile
[INFO] |  \- org.apache.lucene:lucene-highlighter:jar:3.5.0:compile
[INFO] +- org.apache.tika:tika-app:jar:1.2:compile
[INFO] +- log4j:log4j:jar:1.2.17:runtime
[INFO] +- org.testng:testng:jar:6.8:test
[INFO] |  +- org.beanshell:bsh:jar:2.0b4:test
[INFO] |  +- com.beust:jcommander:jar:1.27:test
[INFO] |  \- org.yaml:snakeyaml:jar:1.6:test
[INFO] \- org.hamcrest:hamcrest-all:jar:1.3:test

This generates a 22.1Mb ZIP plugin.

Here is the dependency tree after changing pom.xml with tika-parsers :

[INFO] +- org.elasticsearch:elasticsearch:jar:0.19.0:compile
[INFO] |  +- org.apache.lucene:lucene-core:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-analyzers:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-queries:jar:3.5.0:compile
[INFO] |  +- org.apache.lucene:lucene-memory:jar:3.5.0:compile
[INFO] |  \- org.apache.lucene:lucene-highlighter:jar:3.5.0:compile
[INFO] +- org.apache.tika:tika-parsers:jar:1.2:compile
[INFO] |  +- org.apache.tika:tika-core:jar:1.2:compile
[INFO] |  +- org.gagravarr:vorbis-java-tika:jar:0.1:compile
[INFO] |  |  \- org.gagravarr:vorbis-java-core:jar:tests:0.1:runtime
[INFO] |  +- edu.ucar:netcdf:jar:4.2-min:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.5.6:compile
[INFO] |  +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] |  +- org.apache.james:apache-mime4j-dom:jar:0.7.2:compile
[INFO] |  +- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] |  |  \- org.tukaani:xz:jar:1.0:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.5:compile
[INFO] |  +- org.apache.pdfbox:pdfbox:jar:1.7.0:compile
[INFO] |  |  +- org.apache.pdfbox:fontbox:jar:1.7.0:compile
[INFO] |  |  +- org.apache.pdfbox:jempbox:jar:1.7.0:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  +- org.bouncycastle:bcmail-jdk15:jar:1.45:compile
[INFO] |  +- org.bouncycastle:bcprov-jdk15:jar:1.45:compile
[INFO] |  +- org.apache.poi:poi:jar:3.8:compile
[INFO] |  +- org.apache.poi:poi-scratchpad:jar:3.8:compile
[INFO] |  +- org.apache.poi:poi-ooxml:jar:3.8:compile
[INFO] |  |  +- org.apache.poi:poi-ooxml-schemas:jar:3.8:compile
[INFO] |  |  |  \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] |  |  \- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] |  +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile
[INFO] |  +- asm:asm:jar:3.1:compile
[INFO] |  +- com.googlecode.mp4parser:isoparser:jar:1.0-RC-1:compile
[INFO] |  |  \- org.aspectj:aspectjrt:jar:1.6.11:compile
[INFO] |  +- com.drewnoakes:metadata-extractor:jar:2.4.0-beta-1:compile
[INFO] |  +- de.l3s.boilerpipe:boilerpipe:jar:1.1.0:compile
[INFO] |  +- rome:rome:jar:0.9:compile
[INFO] |  |  \- jdom:jdom:jar:1.0:compile
[INFO] |  +- org.gagravarr:vorbis-java-core:jar:0.1:compile
[INFO] |  \- com.googlecode.juniversalchardet:juniversalchardet:jar:1.0.3:compile
[INFO] +- log4j:log4j:jar:1.2.17:runtime
[INFO] +- org.testng:testng:jar:6.8:test
[INFO] |  +- org.beanshell:bsh:jar:2.0b4:test
[INFO] |  +- com.beust:jcommander:jar:1.27:test
[INFO] |  \- org.yaml:snakeyaml:jar:1.6:test
[INFO] \- org.hamcrest:hamcrest-all:jar:1.3:test

This generates a 21.7Mb ZIP plugin.

New dependency is now:

        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-parsers</artifactId>
            <version>1.2</version>
            <scope>compile</scope>
        </dependency>

Tests already works. Sounds good to me.

I will send a pull request with it and see if it makes sense for @elasticsearch team too.

from elasticsearch-mapper-attachments.

martijnvg avatar martijnvg commented on June 8, 2024

@dadoonet The change in your pull request looks good.

Seems like the tika-core dependency needs to be changed to tika-parsers dependency. Only downside I see now is that the ES plugin directory gets a bit pollute with jar files when users install this plugin.

from elasticsearch-mapper-attachments.

kimchy avatar kimchy commented on June 8, 2024

I am still confuse as to the difference between tike-app and including all the relevant jars on their own? We end up including the same ones, no?

from elasticsearch-mapper-attachments.

fcamblor avatar fcamblor commented on June 8, 2024

Problem with tika-app is it is a "fatjar" dependency.

I spent almost half a day this week debugging my project because of this : I'm using slf4j 1.6 and tika-app embeds slf4j 1.5 classes in it's fatjar.
And a dependency tree doesn't provide any relevant information in that case (in addition to the fact dependency eviction mecanism is not applied on fatjars).

The only solution was to play with dependency ordering to ensure my slf4j is declared before elastic-search-mapper-attachment dependency. I now have knowledge in this, but I think someone else will be trapped like I did if tika-app dep is kept,

from elasticsearch-mapper-attachments.

kimchy avatar kimchy commented on June 8, 2024

I see, so thats what I was missing, I did not understand that you were embedding the plugin in your own Java app, in this case, the change make sense, @martijnvg up for getting it in?

from elasticsearch-mapper-attachments.

martijnvg avatar martijnvg commented on June 8, 2024

Thanks for raising this issue!
Pushed and released a new version.

from elasticsearch-mapper-attachments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.