Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Launching AntRunner to build a external physical build.xml - Could not find one or more classes: "org.apache.tools.ant.BuildListener"

I can't find anything on "classpath, antrunner, eclipse" that
describes this.. so wondering if i got something completely wrong.

I'd created a SampleAction based on the code generated from Plugin
Wizard - the one that says "Hello World".

1. I edited my plugin.xml to indicate dependencies on "org.apache.ant"
and "org.eclipse.ant.ui"
2. I'd added more java code into the run(IAction), to

AntRunner runner = new AntRunner();
runner.setBuildFileLocation("C:/test/build.xml");
runner.run();

This compiles and runs fine in my runtime-workbench, when I run my
SampleAction menu ant quietly runs.

3. However, I do need to track the progress of the build and reflect
back to the UI etc.. so I guess I need a BuildListener?

4. I added a new class MyBuildListener into the same package as my
SampleAction (testing.actions), this class extends BuildListener and
does nothing but writes debug messages via FileWriter when each event
is triggered.

AntRunner runner = new AntRunner();
runner.addBuildListener("testing.actions.MyBuildListener"); // added
runner.setBuildFileLocation("C:/test/build.xml");
runner.run();

Everything compiles fine.

5. I execute the runtime-workbench, but when I run my SampleAction
menu, I get a class not found:

Could not find one or more classes:
"org.apache.tools.ant.BuildListener". Please check the Ant classpath

My runtime-workbench "Preferences > Ant > Runtime > Classpath" is the
default settings. I see it points to my
plugins\org.apache.ant_1.6.2\lib\*.jar and under Global Entries, it
has c:\j2sdk1.4.2_05\lib\tools.jar

What am i missing?

-- 
Keat 
[ today's special: http://rails.yanime.org/rssfwd/ ]


Back to the top