Apache Ant 无法为 OpenIMSCore 的 FHoSS 创建目录

Apache Ant Failing to Make Directory for OpenIMSCore's FHoSS

我正在尝试在我的 Ubuntu 14.04 LTS Linux 计算机上编译 OpenIMSCore 的物理版本。我已按照指定的说明进行操作 here at cnd's website. To verify that I have all of the necessary required programs and libraries, here is a text file outlining all of the different versions of the required programs I am using. This problem seems to be similar to this one,除了我的无法创建目录,他的找不到它们。

为确保我提供最佳可用信息量,这里是 我在终端中执行 ant clean 操作后的调试信息:

/opt/OpenIMSCore/FHoSS$ ant compile -d
Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Trying the default build file: build.xml
Buildfile: /opt/OpenIMSCore/FHoSS/build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.7 in: /usr/lib/jvm/java-7-openjdk-amd64/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: ant.file -> /opt/OpenIMSCore/FHoSS/build.xml
Setting ro project property: ant.file.type -> file
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /opt/OpenIMSCore/FHoSS/build.xml with URI = file:/opt/OpenIMSCore/FHoSS/build.xml
Setting ro project property: ant.project.name -> FHoSS Project
Adding reference: FHoSS Project
Setting ro project property: ant.project.default-target -> compile
Setting ro project property: ant.file.FHoSS Project -> /opt/OpenIMSCore/FHoSS/build.xml
Setting ro project property: ant.file.type.FHoSS Project -> file
Project base dir set to: /opt/OpenIMSCore/FHoSS
 +Target: 
 +Target: init
 +Target: compile
 +Target: jars
 +Target: config
 +Target: script
 +Target: deploy
 +Target: jdoc
 +Target: example
 +Target: clean
 +Target: cleanall
 +Target: deb
Adding reference: ant.LocalProperties
parsing buildfile jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
 [property] Loading /opt/OpenIMSCore/FHoSS/build.properties
Setting project property: path.deploy -> deploy
Setting project property: path.src -> /opt/OpenIMSCore/FHoSS/src
Setting project property: path.srcweb -> /opt/OpenIMSCore/FHoSS/src-web
Setting project property: path.build -> /opt/OpenIMSCore/FHoSS/bin
Setting project property: path.doc -> /opt/OpenIMSCore/FHoSS/docs
Setting project property: path.webdest -> /opt/OpenIMSCore/FHoSS/deploy/webapps/hss.web.console
Setting project property: path.log -> /opt/OpenIMSCore/FHoSS/deploy/logs
Setting project property: path.config -> /opt/OpenIMSCore/FHoSS/deploy
Setting project property: path.script -> /opt/OpenIMSCore/FHoSS/deploy
Setting project property: path.example -> /opt/OpenIMSCore/FHoSS/deploy/examples
Setting project property: compile.debug -> true
Setting project property: compile.deprecation -> true
Setting project property: compile.optimize -> true
Adding reference: compile.classpath
Setting ro project property: ant.project.invoked-targets -> compile
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `compile' is [init, compile]
Complete build sequence is [init, compile, jars, config, script, deploy, example, jdoc, deb, cleanall, clean, ]

init:
Setting project property: DSTAMP -> 20170707
Setting project property: TSTAMP -> 1523
Setting project property: TODAY -> July 7 2017

BUILD FAILED
/opt/OpenIMSCore/FHoSS/build.xml:36: Directory /opt/OpenIMSCore/FHoSS/bin creation was not successful for an unknown reason
at org.apache.tools.ant.taskdefs.Mkdir.execute(Mkdir.java:70)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 0 seconds

这里是 cnd 提供的 build.xml 文件:I put it on Google Drive due to its size and the fact that this post is already lengthy as is。据推测 Apache Ant 失败的点是第 36 行,mkdir 命令:

    <target name="init">
        <tstamp/>
        <mkdir dir="${path.build}" />
    </target>

我希望这对有人帮助我来说足够清楚了。我是 Apache Ant 的新手,所以请耐心等待,但我会尽力提供调试此问题可能需要的任何其他内容。

A​​pache Ant 和 build.xml 都没有问题。

根据this forum post的建议,我是自己创建一个目录。然后我意识到我正在编译的文件夹:

privateusername@privatecomputername-Dimension-E521:/opt/OpenIMSCore/FHoSS$

由于我在 "opt" 文件夹中,这要求我使用根帐户或使用 "sudo" 当启动 "ant compile" 命令时,特别是如果 xml 文件包含 "mkdir" 命令。我希望这对遇到 OpenIMSCore 或 Ant 问题的任何人都有帮助。

吸取教训,始终了解您之前使用的文件夹的属性 运行 Ant:您可能需要 root 权限才能执行某些任务。