首页 > 解决方案 > 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 文件。但是,我需要在用户的安装路径上执行这个脚本。谁能告诉我我做错了什么?

先感谢您。

标签: shellmavenunixinstallationizpack

解决方案


继续讨论和讨论 IzPack 问题的正确位置是用户论坛: https ://groups.google.com/d/msg/izpack-user/eN8wdvE-UIc/Verjnuh0BAAJ


推荐阅读