开发者

Hudson doesn't use Maven-generated classpath?

I'm trying to search the classpath in my project at runtime. We use Maven for build management and Hudson for CI. On my local box, of course, everything works great. However, when Hudson is running unit tests, it can't find classes generated during the build -- Maven should be putting them in ./target/classes, but when I log the classpath (System.getProperty("java.class.path")) from Hudson it only gives me a list with two maven-related JARs -- no directories at all, and certainly not the current project's compiler output directory. Is this Hudson's fault? Maven's? Am I going about this the wrong way?

ETA: I think this might have been fixed by upgrading the Maven runtime used by Hudson. The problem was that we were looking for plugin classes via reflection, similar to the id开发者_开发问答eas in this post -- not that actual code, but it gives you the idea. Anyway, it sounds like Hudson was using a classpath that only "bootstrapped" the actual test harness; for whatever reason it seems to be fixed now. Long story short: if you have a similar problem, try upgrading your Maven.


Two fixes. One, upgrade Maven. Two, don't rely on classpath hackery to iterate over things your classloader can see, a la the "resource discovery" trick linked to in the description.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜