本文整理匯總了Java中org.apache.tools.ant.BuildException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java BuildException.printStackTrace方法的具體用法?Java BuildException.printStackTrace怎麽用?Java BuildException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.BuildException
的用法示例。
在下文中一共展示了BuildException.printStackTrace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: modulesBuild
import org.apache.tools.ant.BuildException; //導入方法依賴的package包/類
/** Execute targets which can fail _without_ throwing BuildException */
private void modulesBuild() throws BuildException {
if ( ! failonerror ) {
// build the rest of modules
for (String module : buildmodules) {
dummy = new Target ();
dummyName = "nbmerge-" + getOwningTarget().getName() + "-" + module;
while (targets.contains (dummyName))
dummyName += "-x";
dummy.setName (dummyName);
dummy.addDependency (targetprefix + module);
getProject().addTarget(dummy);
@SuppressWarnings("unchecked")
Vector<Target> fullList = getProject().topoSort(dummyName, targets);
// Now remove earlier ones: already done.
@SuppressWarnings("unchecked")
Vector<Target> doneList = getProject().topoSort(getOwningTarget().getName(), targets);
List<Target> todo = new ArrayList<>(fullList.subList(0, fullList.indexOf(dummy)));
todo.removeAll(doneList.subList(0, doneList.indexOf(getOwningTarget())));
Iterator<Target> targit = todo.iterator();
try {
while (targit.hasNext()) {
Target nexttargit = targit.next();
String targetname = nexttargit.getName();
if ( builttargets.indexOf(targetname) < 0 ) {
System.out.println(); System.out.println(targetname + ":");
nexttargit.execute();
builttargets.addElement(targetname);
}
}
builtmodules.addElement(module);
} catch (BuildException BE) {
log(BE.toString(), Project.MSG_WARN);
BE.printStackTrace();
failedmodules.addElement(module);
}
}
log("builtmodules=" + builtmodules, Project.MSG_VERBOSE);
log("failedmodules=" + failedmodules, Project.MSG_VERBOSE);
}
}