在安装过程中,我执行一个java类。我将install.xml文件中的一些变量抛到这个java类中。
我的问题是,我看不到向该类抛出IzPack资源路径的方法。没有内置的IzPack变量.
但我知道它存储在某个地方,因为我把它交给了IzPack编译器:
"...\IzPack\bin\compile“"...\install.xml”-b thepathIwouldliketoget
谢谢!
发布于 2014-07-15 18:29:27
@命令-提示:
C:\Program Files\IzPack\bin>compile -?
.:: IzPack - Version 4.3.5 ::.
.......
-> Command line parameters are : (xml file) [args]
(xml file): the xml file describing the installation
-h (IzPack home) : the root path of IzPack. This will be needed
if the compiler is not called in the root directory of IzPack.
Do not forget quotations if there are blanks in the path.
-b (base) : indicates the base path that the compiler will use for filenames
of sources. Default is the current path. Attend to -h. 澄清一下:-b <path-name>并不完全是IzPack resource path。如上所述,它是一个base path,专门用于解析其他文件路径。在上面的示例中,默认值将是当前目录,即C:\Program Files\IzPack\bin。
现在,我还没有测试这个,但是这个路径可能可以通过属性baseDir.访问。
原因有二:
Apache Ant Integration节HERE将此属性指定为'baseDir'。CliAnalyzer.java (查找它和其他源文件,HERE)分析命令行输入,它有以下代码块:if (commandLine.hasOption(ARG_BASEDIR)) { baseDir = commandLine.getOptionValue(ARG_BASEDIR).trim(); }也许,base path应该可以通过${baseDir} or $baseDir访问。
https://stackoverflow.com/questions/15412450
复制相似问题