Monday, April 27, 2015

Ant with JUnit: junitreport BUILDFAILED "...\junit" does not exist

I was working with JUnit and trying to build a junit report using ant's command line tool after export the ant build file on the JUnit test project in Eclipse, however, the following command line running in the test project's root directory (e.g.,  "D:\eclipse_jee_proj\HelloWorldTests") threw out an error:

> ant -buildfile build.xml junitreport
D:\eclipse_jee_proj\HelloWorldTests\build.xml:137: D:\eclipse_jee_proj\HelloWorldTests\junit does not exist.

Total time: 0 seconds

The problem was easily fixed by creating a "junit" folder under the project's root directory " D:\eclipse_jee_proj\HelloWorldTests" (Note that the individual test builds must be run first, otherwise, the junitreport will generate index.html in "junit" folder indicating no test coverage).

No comments:

Post a Comment