- - PR -
Ant実行時のエラーにつきまして
1
| 投稿者 | 投稿内容 | ||||
|---|---|---|---|---|---|
|
投稿日時: 2003-12-17 15:35
いつもお世話になっております。be1300ccです。
Ant実行時のエラー内容がイマイチ分かりませんので、質問させて頂きます。 AntにてJunitを実行させる為に、build.xmlを作成したのですが、実行時にエラーが出てしまい、正常に終了しません。 ********* build.xml ********* <project name="WSDL2C-TEST" basedir="." default="wsdl2c-junit"> <!-- Build Defaults --> <property name="src.dir" value="${basedir}/tests/src"/> <property name="classes.dir" value="${basedir}/tests/classes"/> <property name="report.dir" value="${basedir}/tests/report"/> <!-- Junit --> <target name="wsdl2c-junit"> <junit printsummary="true"> ⇒10行目(エラー部分) <classpath location="${classes.dir}"/> <formatter type="xml"/> <mkdir dir="${report.dir}" /> <batchtest todir="${report.dir}"> <fileset dir="${src.dir}"> <include name="**/*Test.java"/> </fileset> </batchtest> </junit> </target> </project> ********* エラー内容 ********* Buildfile: C:\eclipse\workspace\WSDL2\tests\build.xml wsdl2c-junit: [junit] BUILD FAILED: file:C:/eclipse/workspace/WSDL2/tests/build.xml:10: Could not create task or type of type: junit. Ant could not find the task or a class this task relies upon. This is common and has a number of causes; the usual solutions are to read the manual pages then download and install needed JAR files, or fix the build file: - You have misspelt 'junit'. Fix: check your spelling. - The task needs an external JAR file to execute and this is not found at the right place in the classpath. Fix: check the documentation for dependencies. Fix: declare the task. - The task is an Ant optional task and optional.jar is absent Fix: look for optional.jar in ANT_HOME/lib, download if needed - The task was not built into optional.jar as dependent libraries were not found at build time. Fix: look in the JAR to verify, then rebuild with the needed libraries, or download a release version from apache.org - The build file was written for a later version of Ant Fix: upgrade to at least the latest release version of Ant - The task is not an Ant core or optional task and needs to be declared using <taskdef>. Remember that for JAR files to be visible to Ant tasks implemented in ANT_HOME/lib, the files must be in the same directory or on the classpath Please neither file bug reports on this problem, nor email the Ant mailing lists, until all of these causes have been explored, as this is not an Ant bug. Total time: 230 milliseconds ご享受お願いします。 | ||||
|
投稿日時: 2003-12-17 15:52
そのままですが 見つかりません」とのたまわっています。 junitタスクのクラスをantの実行時のクラスパスに入れなければいけないのでしょう。 JUnit Taskのページによると、 「注釈: (利用者は)junit.jarを持っていなくてはなりません。また<junit>タスクのためのクラスファイルを同じクラスパスの中で動作させねばなりません。以下のいずれかの方法で(利用)出来ます: 」
だそうです。 | ||||
|
投稿日時: 2003-12-17 16:24
antのバージョンが1.5.4より古いと、これと同じようなエラーが出たような記憶があります。
| ||||
|
投稿日時: 2003-12-17 16:28
おばけさん、yuzyさん、アドバイスありがとうございます。
おばけさんの教えて頂いた方法で実行してみたのですが、3つの方法でどれもエラー内容が 変わりませんでした。 Antのバージョンは、1.5.3-1です。 もう少し調べて見たいと思います。 | ||||
|
投稿日時: 2003-12-17 17:14
すみません。
なんとか自己解決できました。 原因は、EclipseのAntの設定の所にtool.jarとjunit.jarの設定が追加されていない ことが原因でした。 お騒がせしました。 | ||||
1
