Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-403

Refactor log library usage in tika-parsers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.7
    • 0.8
    • None
    • None

    Description

      Currently tika has the following direct depencdencies declared in its pom.xml-s:

      tika-core:

      • none

      tika-parent:

      • none

      tika-parsers:

      • commons-logging 1.1.1
      • log4j 1.2.14

      In tika-parsers pom.xml it is stated that commons-logging is only a transitive dependency and it is not used in tika only in poi and it is only there so tika pulls the 1.1.1 version of commons-logging instead of the 1.1 version which is pulled by poi. For this usecase there is a better option in maven: move this depencency declaration from the <depencencies> element to the <dependencyManagement> element. Like so:
      <dependencyManagement>
      <dependencies>
      <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
      </dependency>
      </dependencies>
      </dependencyManagement>
      The result will be the same but tika-parsers will no more say that it directly needs commons-logging as dependency.

      I did a search for "log" in the java files of tika-core and tike-parsers and it seems that only one class uses logging and its org.apache.tika.parser.mbox.MboxParser referencing log4j. I think it should be trivial to modify this class to not depend on log4j and so the log4j depencency could also be removed from the direct dependencies of tika-parsers.

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            akiraly Attila Király
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: