开发者

Plugin classpath issues when running from IDE

I have a maven plugin that transforms class bits after compilation. This plugin works precisely as designed when run from the command line. However, the problem arises in Eclipse (3.6.1) when the Maven project is building from a clean state. What happens is that I get an error message in the console informing me that my plugi开发者_如何学Pythonn has failed due to the inability to find a class that is in fact on the classpath.

As I mentioned, this plugin works perfectly well when I build from the command line, so this is a rather annoying problem that seems a bit difficult to track down.

Has anyone else ran into this problem before, and if so, is there a solution that I'm missing?

Thanks.


I can confirm that the maven eclipse plugin sometimes works different than the "console version". You can try to change the "Preferences->Maven->Installations" to your external maven installation (that what you use when running from command line). The eclipse plugin embedded version is a 3.0-SNAPSHOT (in my installation) and maybe not stable in all points.


The issue turned out to be a difference between Maven 2.x and Maven 3.x. The m2eclipse was using a version of Maven 3.x - can't remember which - and I was running a previous version. Apparently, somewhere in the version range, the plugin mojo now requires @requiresDependencyResolution . Thus, when running in m2eclipse, my plugin was not getting any of the dependencies in the project, and thus the class path was completely boned...

word...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜