Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-239

slf4j-api bundle requires an org.slf4j.impl package present to build in PDE

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.6.x
    • Unspecified
    • None
    • Operating System: Linux
      Platform: PC

    Description

      When building an Eclipse PDE component using Maven, I specify a dependency to slf4j-api in the Maven pom.xml file. In the MANIFEST.MF, I have the line:

      Import-Package: org.slf4j

      This gives an error when I build:

      generate:
      [eclipse.buildScript] Some inter-plug-in dependencies have not been satisfied.
      [eclipse.buildScript] Bundle com.jeppesen.jcms.pws.model:
      [eclipse.buildScript] Unsatisfied import package org.slf4j_0.0.0.
      [eclipse.buildScript] Bundle slf4j.api:
      [eclipse.buildScript] Unsatisfied import package org.slf4j.impl_1.6.0.

      Somewhy, the build process seems to pick up the org.slf4j.impl package import as specified in the manifest file of the slf4j-api bundle, and sees it as a mandatory requirement. As I see it, it shouldn't, since my component can both compile and run without any .impl package.

      A way to work around this is to include the slf4j-nop bundle in the pom file. That one will then satisfy the org.slf4j.impl import. But this creates some other issues with non-intuitive transitive dependencies downstream.

      What does work cleanly - I tested it - is to specify the package import in slf4j-api bundle as optional. That is, in the MANIFEST.MF file, the line should read:

      Import-Package: org.slf4j.impl;version=1.6.0;resolution:=optional

      That way, any build/import process that tries to resolve dependencies can see that it is ok to leave it unresolved.

      I did find http://bugzilla.slf4j.org/show_bug.cgi?id=75 which touches the issue (resolution:=optional is mentioned) but seems to have a larger scope and is about an older version of slf4j. I am using 1.6.2.

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            pblommaskog@hotmail.com Patrik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: