Defining scalac task in Ant

In my ant build.xml files, the scalac tasks are all marked in red. The
"taskdef" tag has an error:

Failed to load type(s): Resource "scala/tools/ant/antlib.xml" not found
in classpath.

This error is very puzzling though since the resource is in
scala-compiler.jar which I have the scala-compiler.jar in the classpath
for the module, in the ant file itself, and in the additional classpath
for the ant build file.

Am I missing something here, or is it broken?



1 comment
Comment actions Permalink

Hi Donald,

We should look at the task definition. IDEA tries to load task's classes from a classpath that is specified in the <taskdef>  tag. All paths, if they are not absolute paths, are resolved using Ant rules against the ant build file, where the taskdef is located. If the path cannot be resolved, the classes won't be loaded.


Please sign in to leave a comment.