本文整理汇总了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);
}
}