简体   繁体   中英

IzPack - Execute shell script file to launch mvn command

First, I have db_migration.sh with content like this

#!/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.

Second, I have this code segment in install.xml file. To mark as executable file after the installation, fix permission denied issue in Unix system

<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; To run my 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

[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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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