没有用eclipse建立一个liferay项目(Ant ivy)

时间:2017-08-03 10:53:01

标签: java eclipse ant liferay-6 ivy

我收到此错误

SELECT UNIX_TIMESTAMP(STR_TO_DATE('Apr 15 2012 12:00AM', '%M %d %Y %h:%i%p'))*1000

在我定义属性名称=" ivy.home":

的行中似乎失败了
BUILD FAILED
C:\---\---\---\build-common-ivy.xml:7: Problem: failed to create task or type if
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

我认为没有定义$ {sdk.dir},但我可以定义它?

1 个答案:

答案 0 :(得分:0)

正如@CAustin所解释的,您的问题是“if”任务不是标准的ANT功能。它是ANT第三方扩展的一部分,名为ant-contrib,我同意最好避免使用。

如果要自动执行常春藤的条件安装,请尝试以下操作:

<project name="demo" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">

    <available classname="org.apache.ivy.Main" property="ivy.installed"/> 

    <target name="install-ivy" unless="ivy.installed">
        <mkdir dir="${user.home}/.ant/lib"/>
        <get dest="${user.home}/.ant/lib/ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"/>
        <fail message="Ivy has been installed. Run the build again"/>
    </target>

    <target name="resolve" depends="install-ivy">
        <ivy:resolve/>

        ..
        ..    

希望这有帮助