首先,我有db_migration.sh,内容如下:
#!/bin/sh
eval "mvn compile flyway:migrate"
那么简单。只是为了减轻用户自己在终端中执行此命令的负担。由于存在“ mvn”,因此此命令当然需要使用pom文件执行,我已经将它们放置在同一目录中。
第二,我在install.xml文件中有此代码段。要在安装后标记为可执行文件,请修复Unix系统中拒绝权限的问题
<executable targetfile="$INSTALL_PATH/Database/orchestra-db/db_migration.sh" os="unix" stage="never" failure="warn" keep="true" />
然后,在ProcessPanel中,我有这个;运行我的db_migration.sh
<job name="do xyz">
<executeForPack name="Orchestra Runtime"/>
<os family="unix" />
<executefile name="$INSTALL_PATH/Database/orchestra-db/db_migration.sh">
<arg>doit</arg>
</executefile>
</job>
但是,当我测试安装程序时,我在ProcessPanel中收到了此错误消息
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.300 s
[INFO] Finished at: 2018-07-19T15:51:52+02:00
[INFO] Final Memory: 5M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/tanyagorn/Documents/OrchestraInstaller/installer/target). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
似乎IzPack正在寻找pom文件并尝试在“目标”目录中执行.sh文件。但是,我需要在用户的安装路径上执行此脚本。谁能告诉我我做错了什么?
谢谢。
答案 0 :(得分:0)
用户论坛是继续讨论和讨论IzPack问题的正确位置: https://groups.google.com/d/msg/izpack-user/eN8wdvE-UIc/Verjnuh0BAAJ