shell - IzPack - 执行 shell 脚本文件以启动 mvn 命令
问题描述
首先,我有这样的内容 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 文件。但是,我需要在用户的安装路径上执行这个脚本。谁能告诉我我做错了什么?
先感谢您。
解决方案
继续讨论和讨论 IzPack 问题的正确位置是用户论坛: https ://groups.google.com/d/msg/izpack-user/eN8wdvE-UIc/Verjnuh0BAAJ
推荐阅读
- mingw-w64 - 使用 MinGW64 构建 assimp
- java - 当我更改活动以继续计算 Android Studio 中的时间时,如何让我的计时器计数?
- html - 用于网络摄像头的 iframe HTML
- c++ - QLineEdit 访问其文本的错误
- javascript - 使用javascript针对不同模态的数据表按钮
- mysql - 此代码中出现错误 1265 的原因是什么?
- python-3.x - 如何调整 Canvas 可滚动小部件的大小?
- swift - 当 List 不仅是子级时,NavigationLink 保持突出显示
- spring - 需要通过读取属性文件来创建bean列表
- unit-testing - 如何使用命令行上的“kotlin.test”依赖项进行编译?