Maven Tycho Plugin Tests and slf4j

If your eclipse-test-plugin tests break in a maven Tycho build, you have to check the target/work/configuration folder for the log files.

Mybe you will find something like this:

!ENTRY de.dim.search.index.tests 2 0 2016-11-03 10:37:31.137
!MESSAGE Could not resolve module: de.dim.search.index.tests [13]
  Unresolved requirement: Require-Bundle: de.dim.search.index.core
    -> Bundle-SymbolicName: de.dim.search.index.core; bundle-version="1.2.0.201611030937"
       de.dim.search.index.core [9]
         Unresolved requirement: Import-Package: org.slf4j
           -> Export-Package: org.slf4j; bundle-symbolic-name="org.slf4j.api"; bundle-version="1.7.5.v20150828-1500"; version="1.7.5"; uses:="org.slf4j.spi"
              org.slf4j.api [11]
                Unresolved requirement: Import-Package: org.slf4j.impl; version="[1.6.0,1.7.6)"; resolution:="optional"
                Unresolved requirement: Require-Capability: org.slf4j.impl; filter:="(&(version>=1.6.0)(!(version>=1.7.6)))"
  Unresolved requirement: Fragment-Host: de.dim.search.index.core; bundle-version="1.2.0"
    -> Bundle-SymbolicName: de.dim.search.index.core; bundle-version="1.2.0.201611030937"


!ENTRY de.dim.search.index.core 2 0 2016-11-03 10:37:31.138
!MESSAGE Could not resolve module: de.dim.search.index.core [9]
  Unresolved requirement: Import-Package: org.slf4j
    -> Export-Package: org.slf4j; bundle-symbolic-name="org.slf4j.api"; bundle-version="1.7.5.v20150828-1500"; version="1.7.5"; uses:="org.slf4j.spi"
       org.slf4j.api [11]
         Unresolved requirement: Import-Package: org.slf4j.impl; version="[1.6.0,1.7.6)"; resolution:="optional"
         Unresolved requirement: Require-Capability: org.slf4j.impl; filter:="(&(version>=1.6.0)(!(version>=1.7.6)))"


!ENTRY org.slf4j.api 2 0 2016-11-03 10:37:31.138
!MESSAGE Could not resolve module: org.slf4j.api [11]
  Unresolved requirement: Import-Package: org.slf4j.impl; version="[1.6.0,1.7.6)"; resolution:="optional"
  Unresolved requirement: Require-Capability: org.slf4j.impl; filter:="(&(version>=1.6.0)(!(version>=1.7.6)))"

The resolution is to add the fragment ch.qos.logback.slf4j to the manifest and mark it as optional debendency.

Ensure that slf4j and logback is in you target platform. You will find it int the Eclipse Orbit.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s