1
是否有可能获得Package.getImplementationVersion()方法用于junits?我正在使用maven和eclipse。我试图执行mvn war:manifest来创建清单文件,所以我可以验证实现版本不为null。junit的Package.getImplementationVersion方法
目前这里是我的测试单元,其失败:
assertNotNull(Version.class.getPackage()getImplementationVersion());
对不起,但我做了你的建议,它的工作!谢谢。此外,我发现这是重复的:http://stackoverflow.com/questions/2916209/how-do-i-make-the-manifest-available-during-a-maven-surefire-unittest-run-mvn-t – Steve