Macos Jenkins-在Mac上使用maven构建JavaFX本机安装程序

Macos Jenkins-在Mac上使用maven构建JavaFX本机安装程序,macos,maven,jenkins,javafx,javafx-8,Macos,Maven,Jenkins,Javafx,Javafx 8,我对Jenkins在Mac上用maven构建JavaFX本机安装程序有问题 我的目标是在Mac上自动创建JavaFX应用程序的本机安装程序(创建*.dmg和*.pkg文件) 我与Jenkins一起安装了Mac服务器,并且能够通过Jenkins任务构建项目(它从GIT获取源代码并调用mvn clean deploy源代码:jar-e-U-t1c) 我还可以通过从ssh控制台调用mvn clean install-f./javafx gui/pom.xml-Pbuild distribution j

我对Jenkins在Mac上用maven构建JavaFX本机安装程序有问题

我的目标是在Mac上自动创建JavaFX应用程序的本机安装程序(创建*.dmg和*.pkg文件)

我与Jenkins一起安装了Mac服务器,并且能够通过Jenkins任务构建项目(它从GIT获取源代码并调用
mvn clean deploy源代码:jar-e-U-t1c

我还可以通过从ssh控制台调用
mvn clean install-f./javafx gui/pom.xml-Pbuild distribution jfx:native
手动构建*.pkg原生安装程序

当我试图从Jenkins运行上面提到的任务(构建本机安装程序)时,问题就出现了,javafxmaven插件:8.8.3:本机插件最后说:

10:00:32[INFO]正在跳过“DMG安装程序”,因为配置错误“无法确定指定的运行时目录中存在哪个JRE/JDK。”

10:00:32修复建议:将运行时目录指向JDK/JRE根目录、该根目录的Contents/Home目录或JDK的Contents/Home/JRE目录之一

我已经尝试在~/.bash_profile和to~/.profile中设置环境变量JAVA_HOME、JRE_HOME、JDK_HOME、JAVA_JRE(变量是在重新登录时设置的,我想这里没有问题)

除此之外,我想不出还有什么可以改变的

注意:我不是Mac用户,我通常在Linux上工作

日志文件:

  ...
10:00:32 [INFO] --- javafx-maven-plugin:8.8.3:native (default-cli) @ javafx-gui ---
10:00:32 [INFO] Building Native Installers
10:00:32 [INFO] Add /Users/jenkins/workspace/(Mac) EasyClient dev CreateInstaller/./javafx-gui/target/jfx/app/config.xml file to application resources.
  ...
10:00:32 [INFO] Add /Users/jenkins/workspace/(Mac) EasyClient dev CreateInstaller/./javafx-gui/target/jfx/app/config.xsd file to application resources.
10:00:32 [INFO] Skipping 'Mac Application Image' because of configuration error 'Cannot determine which JRE/JDK exists in the specified runtime directory.'
10:00:32 Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.
10:00:32 [INFO] Skipping 'DMG Installer' because of configuration error 'Cannot determine which JRE/JDK exists in the specified runtime directory.'
10:00:32 Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.
10:00:32 [INFO] Skipping 'PKG Installer' because of configuration error 'Cannot determine which JRE/JDK exists in the specified runtime directory.'
10:00:32 Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.
10:00:32 [INFO] Skipping 'Mac App Store Ready Bundler' because of configuration error 'Cannot determine which JRE/JDK exists in the specified runtime directory.'
10:00:32 Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.
10:00:32 [INFO] Skipping 'WebStart JNLP Bundler' because of configuration error 'No OutFile Specificed'
10:00:32 Advice to fix: Please specify the name of the JNLP Outut file in 'jnlp.outfile'
10:00:32 [INFO] ------------------------------------------------------------------------
10:00:32 [INFO] BUILD SUCCESS
10:00:32 [INFO] ------------------------------------------------------------------------
10:00:32 [INFO] Total time: 5.919 s
10:00:32 [INFO] Finished at: 2018-09-11T10:00:32+02:00
10:00:32 [INFO] ------------------------------------------------------------------------
10:00:32 Finished: SUCCESS

所以我找到了解决方案——Jenkins提供了自己的JDK。因此,修复程序将JDK组合框设置为
(系统)
。或者在管道脚本中删除“jdk'JDK1.8'”。 该问题是由于复制了Jenkins任务而导致的,而Jenkins任务正是在该任务设置和运行的地方

    tools {
        maven 'M3.5.4'
        jdk 'JDK1.8'  # delete this
    }
    tools {
        maven 'M3.5.4'
        jdk 'JDK1.8'  # delete this
    }