Linux机器上的Ant构建失败

时间:2018-06-08 12:41:25

标签: linux docker jenkins ant

我正在尝试为我公司的一个小项目设置jenkins构建服务器。早期的构建是由Windows机器上的选定开发人员手工制作的。 Ant构建在Windows上运行正常,但在linux机器上(jenkins / jenkins:最新的docker镜像)它无法正常工作。下面是构建失败的步骤:

    <mkdir dir="deploy" />
    <fx:deploy
        embedJNLP="false"
        extension="false"
        includeDT="false"
        offlineAllowed="true"
        outdir="${basedir}/deploy"
        outfile="FILENAME" nativeBundles="all"
        updatemode="background" >

        <fx:platform basedir="${JAVA_HOME}"/>
        <fx:info title="APPNAME" vendor="PCOMPANYNAME"/>

        <fx:application refId="fxApplication" />
        <fx:resources refid="appRes"/>
    </fx:deploy>

以下是jenkins控制台的输出:

Do-Deploy:
 [echo] ::START:: Deployment process
[mkdir] Created dir: /var/jenkins_home/workspace/XXX/build/dist
[mkdir] Created dir: /var/jenkins_home/workspace/XXX/build/dist/libs
 [copy] Copying 32 files to /var/jenkins_home/workspace/XXX/build/dist
[mkdir] Created dir: /var/jenkins_home/workspace/XXX/build/build/classes/META-INF
[mkdir] Created dir: /var/jenkins_home/workspace/XXX/build/deploy
Using base JDK at: /docker-java-home/jre

Using base JDK at: /docker-java-home/jre
Creating app bundle: /var/jenkins_home/workspace/XXX/build/deploy/bundles/XXX
Debian packages should specify a license.  The absence of a license will cause some linux distributions to complain about the quality of the application.

[fx:deploy] java.io.IOException: Exec failed with code 2 command [[fakeroot, dpkg-deb, -b, XXX, /var/jenkins_home/workspace/XXX/build/deploy/bundles/XXX.deb] in /tmp/fxbundler6370267168449686200/images/linux-deb.image
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165)
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.buildDeb(LinuxDebBundler.java:871)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.bundle(LinuxDebBundler.java:363)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.execute(LinuxDebBundler.java:923)
[fx:deploy]     at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:352)
[fx:deploy]     at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:319)
[fx:deploy]     at com.sun.javafx.tools.ant.DeployFXTask.execute(DeployFXTask.java:286)
[fx:deploy]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[fx:deploy]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[fx:deploy]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fx:deploy]     at java.lang.reflect.Method.invoke(Method.java:498)
[fx:deploy]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[fx:deploy]     at org.apache.tools.ant.Task.perform(Task.java:348)
[fx:deploy]     at org.apache.tools.ant.Target.execute(Target.java:435)
[fx:deploy]     at org.apache.tools.ant.Target.performTasks(Target.java:456)
[fx:deploy]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[fx:deploy]     at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[fx:deploy]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fx:deploy]     at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[fx:deploy]     at org.apache.tools.ant.Main.runBuild(Main.java:857)
[fx:deploy]     at org.apache.tools.ant.Main.startAnt(Main.java:236)
[fx:deploy]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
[fx:deploy]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)

BUILD FAILED
/var/jenkins_home/workspace/XXX/build/build.xml:163: Error: Bundler "DEB Installer" (deb) failed to produce a bundle.

Ubuntu 18.04 VM上的相同问题。我迷失了可能是错的。

1 个答案:

答案 0 :(得分:0)

所以我在SO上发现了类似的话题。它还涉及Ubuntu,日志文件还指出案例可能是fakeroot

尝试将此添加到dockerfile apt-get install fakeroot

我正在谈论的话题: unable to create javafx application .deb package for linux