I'm using org.slf4j and ch.qos.logback to log my osgi application, designed and executed under eclipse equinox environnement. everything works well. The SLF4J plugin is declared once,in a feature file, as follow:
<plugin
id="org.slf4j.api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
When I run the application under the eclipse debugger, or when I export the application under the eclipse product export feature, my logs are correctly handled accordingly with the logback.xml.
When I look in the myapp/plugin folder, I find these 2 jars: - org.slf4j.api_1.7.2.v20121108-1250.jar - org.slf4j.log4j_1.7.2.v20130115-1340.jar
But, when I build the application with TYCHO and MAVEN, I find 2 different versions of org.slf4j.api in the myapp/plugins/ folder:
as a result, when I execute the application, the following message is displayed:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
osgi> log4j:WARN No appenders could be found for logger (org.quartz.impl.StdSchedulerFactory).
log4j:WARN Please initialize the log4j system properly.
It looks like the org.slf4j.api_1.7.10 jar is included in the build and breaks the logging mechanism.
This breaks my automatic build.
Please help.
Thanks.
EDIT I'm not using target files. In the main pom file, I've set 2 repositories:
<repositories>
<repository>
<id>eclipse</id>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
<repository>
<id>orbit</id>
<url>http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/</url>
<layout>p2</layout>
</repository>
I've finally found where the issue was:
p2 repositories are incompatibles. I've synchronized URLs and now it's ok.
<repositories>
<repository>
<id>eclipse</id>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
<repository>
<id>orbit</id>
<url>http://download.eclipse.org/tools/orbit/R-builds/R20170307180635/repository/</url>
<layout>p2</layout>
</repository>
</repositories>
@Andreas: Thank you for your help.