“.ant不存在”错误构建Aibu

时间:2017-01-24 22:12:55

标签: java macos ant

我使用Ant成功构建了CoffeeShop(https://github.com/lukacu/coffeeshop)。但是,我无法构建Aibu,一个图像序列注释器。

pc-194-6:aibu June$ ant
Buildfile: /Users/liangjun/Documents/aibu/build.xml

常春藤:

BUILD FAILED
/Users/liangjun/Documents/aibu/build.xml:13: /Users/liangjun/.ant does not exist.

2 个答案:

答案 0 :(得分:1)

我在使用ant build构建jar时遇到了类似的问题。 我通过mkdir ~/.ant/lib“解决”了它 并重新运行ant compile jar 并且成功运行。

似乎有点俗气:-)

答案 1 :(得分:0)

尝试删除

<fileset dir="${user.home}/.ant/" includes="*.jar"/>

build.xml文件中的行。

这是构建过程查找Ivy安装文件的位置。看来它们不在这个目录中......

查看Ivy installation doc

  

如果你只想在你的ant构建脚本中使用Ivy,并在构建时拥有互联网连接,你可以从这个站点下载Ivy并使用这个简单的构建片段自动使用下载的版本:

<condition property="ivy.home" value="${env.IVY_HOME}">
  <isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

<target name="download-ivy" unless="offline">

    <mkdir dir="${ivy.jar.dir}"/>
    <!-- download Ivy from web site so that it can be used even without any special installation -->
    <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
         dest="${ivy.jar.file}" usetimestamp="true"/>
</target>

<target name="init-ivy" depends="download-ivy">
  <!-- try to load ivy here from ivy home, in case the user has not already dropped
          it into ant's lib dir (note that the latter copy will always take precedence).
          We will not fail as long as local lib dir exists (it may be empty) and
          ivy is in at least one of ant's lib dir or the local lib dir. -->
    <path id="ivy.lib.path">
        <fileset dir="${ivy.jar.dir}" includes="*.jar"/>

    </path>
    <taskdef resource="org/apache/ivy/ant/antlib.xml"
             uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>

不要忘记使用以下命令在本地缓存中发布coffeeshop artefact:

ant publish-working

在构建aibu项目之前。