cannot execute ANT script task

Hello,

I have a problem executing an ANT "script" task from within IDEA. The task executes without problems from the command line, but gives the error shown below in IDEA. I have all the required jar files in IDEA/lib (same as for command line version), so that should not be the problem.

The ANT version used in IDEA does not seem very helpful with regard to error messages. On the command line (ANT 1.5) I got ClassNotFoundErrors that I could easily mend, but the stuff below is as useless as it is verbose..


/home/cse/dell/work/webtest/jelly/build/build.xml:31: Could not create task or type of type: script.

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 'script'.
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 ]]>.

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.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:324)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:240)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:115)
at org.apache.tools.ant.Task.perform(Task.java:318)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at com.intellij.rt.ant.execution.AntMain.runBuild(AntMain.java:493)
at com.intellij.rt.ant.execution.AntMain.start(AntMain.java:166)
at com.intellij.rt.ant.execution.AntMain.main(AntMain.java:191)

3 comments

You need to set the properties for the script itself via the ant launcher in
IDEA. Right click the build script xml file in the launcher and select
properties and you'll be able to add the script libraries there. I had to
do that for running python scripts within a build file I use -- added
bsf.jar and jpython.jar. It's pretty simple, but you have to do it for each
build file separately which is a bit of a pain. You can probably acheive it
globablly via IDEA's launch script, but I'm not sure.

Andy

"Christian Sell" <christian.sell@netcologne.de> wrote in message
news:8158597.1046220001270.JavaMail.jrun@is.intellij.net...

Hello,

>

I have a problem executing an ANT "script" task from within IDEA. The task

executes without problems from the command line, but gives the error shown
below in IDEA. I have all the required jar files in IDEA/lib (same as for
command line version), so that should not be the problem.
>

The ANT version used in IDEA does not seem very helpful with regard to

error messages. On the command line (ANT 1.5) I got ClassNotFoundErrors that
I could easily mend, but the stuff below is as useless as it is verbose..
>
>

/home/cse/dell/work/webtest/jelly/build/build.xml:31: Could not create

task or type of type: script.
>

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 'script'.
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.
at

org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java
:324)

at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:240)
at

org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:115)

at org.apache.tools.ant.Task.perform(Task.java:318)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at com.intellij.rt.ant.execution.AntMain.runBuild(AntMain.java:493)
at com.intellij.rt.ant.execution.AntMain.start(AntMain.java:166)
at com.intellij.rt.ant.execution.AntMain.main(AntMain.java:191)

>


0

wow, thanks alot. I had already given up on that one. It seems very strange that I would have to manually add libraries that reside in IDEA_HOME/lib. What makes this more irritating is the fact that the ANT "script" tag was marked as an error until I put the BSF jar into IDEA_HOME/lib. After that it was shown as valid, but would not execute.

I guess this is a bug and should go into the tracker..

thanks anyway,
Christian

0

A bit late, but I had the same problem and got this:
http://www.intellij.com/docs/AntIdea.pdf

"Andrew" <andrew@noemail.net> wrote in message
news:b3rc8u$uqi$1@is.intellij.net...

You need to set the properties for the script itself via the ant launcher

in

IDEA. Right click the build script xml file in the launcher and select
properties and you'll be able to add the script libraries there. I had to
do that for running python scripts within a build file I use -- added
bsf.jar and jpython.jar. It's pretty simple, but you have to do it for

each

build file separately which is a bit of a pain. You can probably acheive

it

globablly via IDEA's launch script, but I'm not sure.

>

Andy

>

"Christian Sell" <christian.sell@netcologne.de> wrote in message
news:8158597.1046220001270.JavaMail.jrun@is.intellij.net...

Hello,

>

I have a problem executing an ANT "script" task from within IDEA. The

task

executes without problems from the command line, but gives the error shown
below in IDEA. I have all the required jar files in IDEA/lib (same as for
command line version), so that should not be the problem.
>

The ANT version used in IDEA does not seem very helpful with regard to

error messages. On the command line (ANT 1.5) I got ClassNotFoundErrors

that

I could easily mend, but the stuff below is as useless as it is verbose..
>
>

/home/cse/dell/work/webtest/jelly/build/build.xml:31: Could not create

task or type of type: script.
>

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 'script'.
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.
at

>
org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java

:324)

at

org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:240)

at

>
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:115)

at org.apache.tools.ant.Task.perform(Task.java:318)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at com.intellij.rt.ant.execution.AntMain.runBuild(AntMain.java:493)
at com.intellij.rt.ant.execution.AntMain.start(AntMain.java:166)
at com.intellij.rt.ant.execution.AntMain.main(AntMain.java:191)

>

>
>


0

Please sign in to leave a comment.