2

I am examining some java static analysis tools.

findbugs, checkstyle, javancss, pmd and jdepend. A previous stackoverflow question regarding tool recommendations Static Analysis tool recommendation for Java?

My problem, the only tool I am having an issue with running is jdepend. The homepage is http://clarkware.com/software/JDepend.html.

I have followed the installation instructions and I have tried the example target. But it did not work for me. Listing missing jars.

Regardless of it working or not. I would prefer to have a taskdef, defining classpath, and classname. I cant find an example of this. Does anyone have a working example of this?

Community
  • 1
  • 1
user230272
  • 63
  • 6

1 Answers1

0

Usually, a static tool (a jar file, example findbugs.jar) has a taskdef (FindBugsTask) inside. When you declare the taskdef in ant build.xml file, the jar file (findbugs.jar) is found and run.

But, with jdepend:

  • jdepend.jar does not include taskdef (JdependTask)
  • ant can understand jdepend task

It's mean that, you must include jdepend.jar into CLASSPATH

2 Solutions:

  1. use CLASSPATH: export CLASSPATH=$CLASSPATH:path_to_jdepend.jar
  2. in ant command line: ant -f -lib path_to_jdepend.jar
binhgreat
  • 982
  • 8
  • 13