Maven 插件构建但由于 java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory 无法执行
我在 pom.xml 中使用 maven-jspc-plugin。
当我尝试执行 jsp-compile 目标(执行插件)时,我得到:
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.juli.logging.Slf4jLog.<init>(Slf4jLog.java:29)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:54)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:35)
at org.apache.sling.scripting.jsp.jasper.compiler.OriginalTldLocationsCache.<init>(OriginalTldLocationsCache.java:81)
at org.apache.sling.maven.jspc.JspcMojo.initServletContext(JspcMojo.java:426)
我已经尝试下载 maven-jspc-plugin 的(开放)源代码,并且我能够轻松地“mvn install” - 我不知道没有遇到任何构建问题,但是当我在项目 pom 中使用该构建时,它仍然崩溃并告诉我它找不到 LoggerFactory。
我已经记录了 Apache Sling 项目的问题,但没有取得太大进展。 https://issues.apache.org/jira/browse/SLING-2350 此链接包含更多故障排除信息以及使用 Maven 插件的简单 Maven 项目。下载 jspc-test.zip 和“mvn install”将导致我提到的错误。
另外,我查看了 org.apache.juli pom.xml,它似乎根本没有列出任何依赖项。
任何关于如何解决的想法将不胜感激。
谢谢!
I am using the maven-jspc-plugin in my pom.xml.
When i try to execute the jsp-compile goal (which executes the plugin) I get:
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.juli.logging.Slf4jLog.<init>(Slf4jLog.java:29)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:54)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:35)
at org.apache.sling.scripting.jsp.jasper.compiler.OriginalTldLocationsCache.<init>(OriginalTldLocationsCache.java:81)
at org.apache.sling.maven.jspc.JspcMojo.initServletContext(JspcMojo.java:426)
I've tried downloading the (open) source for the maven-jspc-plugin and i am able to easily "mvn install" -- I don't get any build issues, however when i use that build in my project pom it still crashes and tells me it can't find LoggerFactory.
I've logged an issue with the Apache Sling project but am not making much headway.
https://issues.apache.org/jira/browse/SLING-2350
This link includes some more troubleshooting info as well as a simple maven project that uses the maven plugin. downloading the jspc-test.zip and "mvn install"ing will result in the error I've mentioned.
Also, i took a peak at the org.apache.juli pom.xml and it doesnt appear to list any dependencies at all.
Any thoughts on how to resolve would be appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
插件依赖项是在 POM 的不同部分中提供的:
尽管听起来如果它们的 POM 尚未指定 slf4j,则它是无效的。
Plugin dependencies are supplied in a different part of the POM:
Though it does sounds like their POM is invalid if it doesn't already specify slf4j.