Check if a package exist in Ant script?
I am writing Ant script to generate Javadoc for my program. the ant script as:
<javadoc access="public"
source="1.6"
sourcepath="${basedir}/../${current.project}/src"
destdir="${basedir}/dist/doc/${curr开发者_JAVA技巧ent.project}"
packagenames="${current.project}" />
But I got trouble if the ${current.project} (packagenames="${current.project}")
does not exist, then Ant will throw error and stop the progress.
I want to ask is there any way to check that if the package name (${current.project}
) does not exist, then Ant will continue to do its jobs until end?
you could add the attribute failonerror="false"
to your javadoc task, so it will prevend the whole build from failing - but the javadoc task won´t run anyway.
精彩评论