Reputation: 764
my main-build.xml looks like:
<path id="run.classpath">
<pathelement location="${build.lib.dir}/ant-{version}.jar"/>
<pathelement location="${third-party.lib.dir}/some-{my-ver}.jar"/>
</path>
deploy.xml uses taskdef ant task on one of class present inside third-party jar:
<taskdef name="run-third-party-exec" classname="package.name.ThirdPartyExec"/>
sub-build.xml imports main-build.xml & deploy.xml
and tries to run a ant target present in deploy.xml but fails complaining
taskdef package.name.ThirdPartyExec cannot be found
How to resolve such problem. Since all taskdefs & imports get executed when we import a file prior to executing a target its failing. Not sure on adding all complaining thirdparty jar's to ant's classpath is right way or not?.
Upvotes: 1
Views: 931
Reputation: 7051
Your <taskdef>
needs to know where to find package.name.ThirdPartyExec
. Do this by providing the classpath:
<taskdef
name="run-third-party-exec"
classname="package.name.ThirdPartyExec"
classpathref="run.classpath"
/>
Upvotes: 1