首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Izpack,Java -将资源路径作为变量

Izpack,Java -将资源路径作为变量
EN

Stack Overflow用户
提问于 2013-03-14 14:45:50
回答 1查看 816关注 0票数 1

在安装过程中,我执行一个java类。我将install.xml文件中的一些变量抛到这个java类中。

我的问题是,我看不到向该类抛出IzPack资源路径的方法。没有内置的IzPack变量.

但我知道它存储在某个地方,因为我把它交给了IzPack编译器:

"...\IzPack\bin\compile“"...\install.xml”-b thepathIwouldliketoget

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2014-07-15 18:29:27

@命令-提示:

代码语言:javascript
复制
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 IntegrationHERE将此属性指定为'baseDir'
  • 文件CliAnalyzer.java (查找它和其他源文件,HERE)分析命令行输入,它有以下代码块:if (commandLine.hasOption(ARG_BASEDIR)) { baseDir = commandLine.getOptionValue(ARG_BASEDIR).trim(); }

也许,base path应该可以通过${baseDir} or $baseDir访问。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15412450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档