Error while building project in eclipse using ANT-compiler attribute
compile-attributes:
BUILD FAILED: 13: Could not create task or type of type: attribute-compiler.
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 'attribute-compiler'.
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 the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
task and make sure it contains more than merely a META-INF/MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the needed
libraries present in ${ant.home}/lib/optional/ , or alternatively,
download a pre-built 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>.
- You are attempting to use a task defined using
<presetdef> or <macrodef> but have spelt wrong or not
defined it at the point of use
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
Re: Error while building project in eclipse using ANT-compiler attribute
And what's the problem? You've given us no context to help you out. What is the build file? Do you have the path setup for the tools ant is trying to access? And finally, please be forthright and let us know about crossposts:
This thread has been cross posted here:
http://www.java-forums.org/eclipse/50557-how-configure-ant-eclipse-i-am-getting-error.html
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting
Re: Error while building project in eclipse using ANT-compiler attribute
The build file is cattributes-build.xml. here is the build file ..
<?xml version="1.0" encoding="UTF-8"?>
<project default="compile-attributes" name="XXXX" basedir=".">
<taskdef resource="org/apache/commons/attributes/anttasks.properties"/>
<target name="clean" description="Clean up the generated files">
<delete>
<fileset dir="${basedir}" includes="*.class,*$*"/>
</delete>
</target>
<target name="compile-attributes" depends="clean" description="Run the Commons Attributes precompiler">
<attribute-compiler destdir="${basedir}/../.cattributes">
<fileset dir="${basedir}/../src" includes="**/*.java"/>
</attribute-compiler>
</target>
</project>
----------------
I have added all the relevant jar files in library. It also has "commons-attribute-compiler.jar" and "commons-attribute-api.jar". when i try to build the project in eclipse, it throws the error message given below.
I have set the ANT_HOME and JAVA_HOME variables. Also set the class path to add "C:\apache-ant-1.8.2-bin\apache-ant-1.8.2\bin"
Please let me know where am i going wrong. am i missing any jar to be uploaded. or is there any ANT version issue ?