From Maven, how do I run a class that lives under src/test/java?

前端 未结 4 1933
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 18:36

I have inherited a codebase :)

Under src/test/java/ there\'s a file that I need to run (I need to run its public static void main(String[] args), not a

4条回答
  •  再見小時候
    2020-12-30 19:08

    Ok, spurred on by it working for everyone else I dug a little harder. The code wasn't reporting its problems very well and I was misreading the stacktrace.

    It does:

    FileInputStream is = new FileInputStream("lib/other-thing.jar");
    

    which was failing. I symlinked trunk/src/main/assembly/lib/ into trunk/ and now it works. There might be a neater way to fix that then the symlink, though.

    Thank you chaps.

提交回复
热议问题