简体   繁体   English

IzPack-执行shell脚本文件以启动mvn命令

[英]IzPack - Execute shell script file to launch mvn command

First, I have db_migration.sh with content like this 首先,我有这样的内容db_migration.sh

#!/bin/sh
eval "mvn compile flyway:migrate"

So, simple. 很简单。 Just to ease users from executing this command in the terminal by themselves. 只是为了减轻用户自己在终端中执行此命令的负担。 Due to 'mvn', Of course, this command need to be executed with pom file, which I already place them together in the same directory. 由于“ mvn”,当然,此命令需要使用pom文件执行,我已经将它们放置在同一目录中。

Second, I have this code segment in install.xml file. 其次,我在install.xml文件中有此代码段。 To mark as executable file after the installation, fix permission denied issue in Unix system 要在安装后标记为可执行文件,请修复Unix系统中的拒绝权限问题

<executable targetfile="$INSTALL_PATH/Database/orchestra-db/db_migration.sh" os="unix" stage="never" failure="warn" keep="true" />

Then, in the ProcessPanel I have this; 然后,在ProcessPanel中,我有这个; To run my db_migration.sh 运行我的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>

However, when I test my installer, I got this error message in the ProcessPanel 但是,当我测试安装程序时,我在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

Seem like IzPack is looking for pom file and try to execute .sh file in 'target' directory. 似乎IzPack正在寻找pom文件并尝试在“目标”目录中执行.sh文件。 But, I need this script to be executed at the user's install path. 但是,我需要在用户的安装路径上执行此脚本。 Can anyone tell me what did I do wrong? 谁能告诉我我做错了什么?

Thank you in advance. 先感谢您。

用户论坛是继续讨论并讨论IzPack问题的合适地方: https : //groups.google.com/d/msg/izpack-user/eN8wdvE-UIc/Verjnuh0BAAJ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM