kakakakakku blog

Weekly Tech Blog: Keep on Learning!

AntでJDependを走らせるとエラーになる

Ant(1.8.4)でJDependを実行しようとして,Using JDepend With Antに載ってるサンプルコードを走らせたところ,以下のエラーが出た.エラーを見る限り,単純に タスクを見つけられていないのが原因のよう.JDependはAntにバンドルされてる認識だったので,特に何もせずに実行できると思っていたけど,そうではないらしい.

解決策としては,jdepend.jarを %ANT_HOME%\lib に置いておけば良さそう.
ちなみにjdepend.jarを手に入れる方法は,Downloading JDepend参照で,ダウンロードしたzipを解凍して,libディレクトリに置いてあるjdepend-.jarを取得するか,GitHubから落としたファイル群を自分でビルド(ant jarするだけ)して,distディレクトリに吐かれるjdepend-.jarを取得する.どちらでもお好きな方で.

BUILD FAILED
C:\ant_jdepend\build.xml:5: Problem: failed to create task or type jdepend
Cause: Could not load a dependent class jdepend/xmlui/JDepend
It is not enough to have Ant's optional JARs
you need the JAR files that the optional tasks depend upon.
Ant's optional task dependencies are listed in the manual.
Action: Determine what extra JAR files are needed, and place them in one of:
-C:\Program Files\apache-ant-1.8.4\lib
-C:\Users\XXX\.ant\lib
-a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem


Total time: 0 seconds