Description of problem: When using "Run as..." - "Maven build" in a Maven project under Eclipse I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2570) at java.lang.Class.getMethod0(Class.java:2813) at java.lang.Class.getMethod(Class.java:1663) at org.codehaus.plexus.classworlds.launcher.Launcher.getEnhancedMainMethod(Launcher.java:172) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:268) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227) ... 9 more Version-Release number of selected component (if applicable): $ rpm -q eclipse-m2e-core eclipse-m2e-core-1.4.0-11.1.fc20.noarch $ rpm -q slf4j slf4j-1.7.5-3.fc20.noarch How reproducible: Always Steps to Reproduce: 1. Install eclipse, eclipse-m2e-core and slf4j 2. git clone https://github.com/zxing/zxing.git 3. from Eclipse "Import" - "Maven" - "Existing Maven Projects" 4. select folder "zxing/core" 5. after import try "Run as" - "Maven build" Actual results: The backtrace listed above appears in Console tab. Expected results: Maven build runs without complaining.
I was just able to reproduce this as well. It seems like sl4fj.api is not accessible by the maven runtime. It's an OSGi bundle, and everything certainly resolves correctly but I don't think that Maven is able to load the class unless it is directly bundled into the maven runtime plugin. I did the following workaround : cd /usr/share/eclipse/dropins/eclipse-m2e-core/eclipse/plugins/org.eclipse.m2e.maven.runtime-1.4.0-SNAPSHOT/jars sudo ln -s /usr/share/java/slf4j/slf4j-api.jar . Then in /usr/share/eclipse/dropins/eclipse-m2e-core/eclipse/plugins/org.eclipse.m2e.maven.runtime-1.4.0-SNAPSHOT/META-INF/MANIFEST.MF add ',jars/slf4j-api.jar' to the end of the list of Bundle-ClassPath entries. I started Eclipse back up with the '-clean' option and the build proceeded.
@Diego: thanks for taking the time to report. @Roland: thanks for taking the time to diagnose & produce a workaround. I'll push a fix & create an update asap.
eclipse-m2e-core-1.4.0-12.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/eclipse-m2e-core-1.4.0-12.fc20
(In reply to Fedora Update System from comment #3) > eclipse-m2e-core-1.4.0-12.fc20 has been submitted as an update for Fedora 20. > https://admin.fedoraproject.org/updates/eclipse-m2e-core-1.4.0-12.fc20 This adds the fix that Roland provided here. It fixes the issue for me. If you would like to test it, please do and give karma in bodhi! :)
Package eclipse-m2e-core-1.4.0-12.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing eclipse-m2e-core-1.4.0-12.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-8907/eclipse-m2e-core-1.4.0-12.fc20 then log in and leave karma (feedback).
eclipse-m2e-core-1.4.0-12.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.