maven提供的依赖将导致intellij中的NoClassDefFoundError? [英] maven provided dependency will cause NoClassDefFoundError in intellij?
本文介绍了maven提供的依赖将导致intellij中的NoClassDefFoundError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
IntelliJ 在运行时似乎没有将提供的依赖项放在类路径上,但我可以在 Eclipse 中成功完成此操作。
因为它对我来说更方便,我怎么能在 IntelliJ 中做到这一点?
IntelliJ doesn't seem to put the provided dependency on the classpath when I run it, however I can do this successfully in Eclipse.
As it would be a lot more convenient for me, how can I do this in IntelliJ?
推荐答案
<我遇到了同样的问题。 Intellij不在类路径中包含提供的依赖项。请参见此来源。我找到的最佳解决方案是使用 exec:java
目标将其作为maven应用程序运行。例如:
I'm having the same problem. Intellij does not include provided dependencies in classpath. See this source. The best solution I found is to run it as maven app, using the exec:java
goal. For example:
exec:java -Dexec.classpathScope=compile -Dexec.mainClass=com.splout.db.integration.NShardEnsemble -Dexec.args=4
欢迎更好的解决方案。
Better solutions are welcome.
这篇关于maven提供的依赖将导致intellij中的NoClassDefFoundError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文