Java から Oracle SOA コンポジットをデプロイするユースケースがあります。このために、Apache ANT API を使用して、Java コードから ant-sca-package.xml ant ファイルを呼び出しています。
File buildFile = new File("/xyz/fmwhome/AS11gR1SOA/bin/ant-sca-compile.xml");
Project p = new Project();
p.setUserProperty("ant.file", buildFile.getAbsolutePath());
DefaultLogger consoleLogger = new DefaultLogger();
consoleLogger.setErrorPrintStream(System.err);
consoleLogger.setOutputPrintStream(System.out);
consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
p.addBuildListener(consoleLogger);
try {
p.fireBuildStarted();
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.setProperty("scac.input", "/xyz/Sample/Sample/composite.xml");
p.executeTarget(p.getDefaultTarget());
p.fireBuildFinished(null);
} catch (BuildException e) {
p.fireBuildFinished(e);
}
次のエラーが表示されます。
/xyz/fmwhome/AS11gR1SOA/bin/ant-sca-compile.xml:201: /xyz/fmwhome/AS11gR1SOA/bin/${env.JAVA_HOME}/lib が見つかりません。
Ant ファイルに必要なすべての jar をコードからクラスパスに追加する必要がありますか? jdeveloperのプロジェクトのライブラリとクラスパスセクションにすでに追加しています。
何が欠けているのかわからない。入力してください。
前もって感謝します。