On Tue, Apr 10, 2001 at 08:43:45AM +0200, Stefan Bodewig wrote:
> Kai Bartels <[EMAIL PROTECTED]> wrote:
>
> > When I only insert the taskdef into the build file, the jar is not
> > required, but as soon as I insert a target that uses ajc, ant tries
> > to instantiate the AJC class while parsing the build file (I'm not
> > trying to _use_ the task at that point!).
>
> Ant >= 1.2 should try to instantiate the task but fail silently (and
> retry later) as long as you don't use the task.
>
> It should work the way you are doing it, i.e. as long as you don't run
> the target (or one that depends on it) that includes your aspectj
> task, you don't need the required libraries in your path.
I think, that's what I'm doing (ant 1.3).
> If it doesn't work, please give us a little more information (build
> file snippet and "ant -verbose" output would be a good start).
That's easy ... (*punch*,*punch*) ... here you are.
Ant runs OK when the jar is in place, but as soon as I move it, this happens.
Thanks for having a look, Kai
--
"Apologize, v.i. To lay the foundation for a future offense."
<Ambrose Bierce>
[EMAIL PROTECTED] + www.picturesafe.de
picturesafe GmbH, Lueerstr. 3, D-30175 Hannover fon:+49 511 85620 56
++ PGP Key fingerprint = D2 B9 58 DC 36 52 DB 6C 18 CC 43 9F 68 E0 21 97 ++
<!-- atlas build file -->
<!-- $Id: build.xml,v 1.42 2001/04/04 12:45:28 tstraube Exp $-->
<project name="atlas" default="compile" basedir=".">
<taskdef name="ajc" classname="org.aspectj.tools.ant.taskdefs.Ajc"/>
[...]
<target name="prepare">
[...]
</target>
<target name="copyFiles" depends="prepare">
[...]
</target>
<target name="compile" depends="copyFiles">
<javac srcdir="${src.dir}"
[...]
</javac>
</target>
<target name="aspect" depends="copyFiles">
<ajc srcdir="${src.dir}"
destdir="${compile.dir}"
debug="${build.debug}"
deprecation="off"
classpath="${build.classpath}">
<exclude name="**/CVS/*" />
<exclude name="de/picturesafe/**/AtlasDocumentAdapter.java" />
<exclude name="de/picturesafe/**/DocumentGridModelAdapter.java" />
<exclude name="de/picturesafe/**/ResinStarter.java" />
</ajc>
</target>
<target name="jar" depends="compile">
[...]
</target>
[...]
<target name="clean">
<delete dir="${clean.dir}"/>
</target>
</project>
9:07 kaba@wintermute:~/Projects/atlas>ant -verbose compile
Ant version 1.3 compiled on March 2 2001
Buildfile: build.xml
Detected Java Version: 1.3
Detected OS: Linux
parsing buildfile /home/kaba/Projects/atlas/build.xml with URI =
file:/home/kaba/Projects/atlas/build.xml
Project base dir set to: /home/kaba/Projects/atlas
BUILD FAILED
/home/kaba/Projects/atlas/build.xml:13: taskdef class
org.aspectj.tools.ant.taskdefs.Ajc cannot be found
--- Nested Exception ---
java.lang.ClassNotFoundException: org.aspectj.tools.ant.taskdefs.Ajc
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at org.apache.tools.ant.taskdefs.Taskdef.execute(Taskdef.java:111)
at
org.apache.tools.ant.ProjectHelper$TaskHandler.finished(ProjectHelper.java:482)
at
org.apache.tools.ant.ProjectHelper$AbstractHandler.endElement(ProjectHelper.java:204)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
at org.apache.tools.ant.Main.runBuild(Main.java:403)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 1 second
9:08 kaba@wintermute:~/Projects/atlas>