2011-02-04 48 views

回答

2

可能是,有一個在過去一段時間的討論開始沒有XSD,但至少自2011年5月的常青藤計劃在

http://ant.apache.org/ivy/schemas/ivy.xsd

這是在http://ant.apache.org/ivy/從文檔右側掛有據可查

如此,重新開始使用該計劃,你只需要:

<?xml version="1.0" encoding="UTF-8"?> 
<project name="yourproject" 
     xmlns:ivy="antlib:org.apache.ivy.ant" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" 
> 
<!-- … --> 
+0

這是錯誤的XSD。該XSD適用於「ivy.xml」文件。注意它沒有「解析」元素。 – 2017-03-25 01:46:09

0

我想this discussion可能會幫到你。看起來,常春藤ant任務沒有xsd,但Eclipse自動完成。

+0

是,否XSD常春藤螞蟻任務avialable。但我發現在intellij IDEA中創建自動完成的方式 – popalka 2011-02-04 13:02:31

0

是的,沒有XSD的常春藤螞蟻任務avialable。但我發現做自動完成在Ant構建文件的IntelliJ IDEA 需要定義附加任務的方式:

<property name="ivy.jar.dir" value="C:/Apache/apache-ivy-2.2.0/"/> 


<taskdef resource="org/apache/ivy/ant/antlib.xml" 
       uri="antlib:org.apache.ivy.ant"> 
     <classpath> 
       <fileset dir="${ivy.jar.dir}" includes="*.jar"/> 
     </classpath> 
</taskdef> 
4

我剛纔複製的常春藤罐子INTELLIJ_HOME/lib中/螞蟻,現在的IntelliJ可以解決ivy任務。

或者將這個ant文件導入到您的ant項目中,它實際上是ivy文檔中的第一個ivy示例,請確保始終依賴於install-ivy目標,將您的ant文件添加到ant構建窗口的想法中,必須安裝常春藤和想法承認常春藤任務。

<property name="ivy.jar.dir" value="${user.home}/.ivy2/jars" /> 
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> 

<property name="ivy.install.version" value="2.2.0" /> 


<target name="check-ivy-installed" unless="INTERN-ivy.jar.exists"> 
    <available property="INTERN-ivy.jar.exists" file="${ivy.jar.file}"/> 
</target> 


<target name="download-ivy" depends="check-ivy-installed" unless="INTERN-ivy.jar.exists"> 
    <echo message="downloading and installing ivy"/> 
    <mkdir dir="${ivy.jar.dir}"/> 
    <!-- download Ivy from web site so that it can be used even without any special installation --> 

    <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
     dest="${ivy.jar.file}" usetimestamp="true"/> 
    <echo message="ivy installed"/> 
</target> 

<!-- ================================= 
     target: install-ivy   
     this target is not necessary if you put ivy.jar in your ant lib directory 
     if you already have ivy in your ant lib, you can simply remove this 
     target and the dependency the 'go' target has on it 
    ================================= --> 
<target name="install-ivy" depends="download-ivy" description="--> install ivy"> 
    <!-- try to load ivy here from local ivy dir, 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. --> 
    <echo message="Installing ivy"/> 
    <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>  

0

XML插件jEditAntCompleteTask定義(ant任務),其產生被稱爲ant-complete.xml的XML文件。生成的文件看起來如下:

<element-list> 
<!-- ... --> 
<element name="classpath" 
content="(fileset|dirset|extdirs|existing|filelist|pathelement|path)"> 
<attribute name="id" type="ID" /> 
<attribute name="location" type="CDATA" /> 
<attribute name="cache" type="(true|false|on|off|yes|no)" /> 
<attribute name="refid" type="CDATA" /> 
<attribute name="description" type="CDATA" /> 
<attribute name="path" type="CDATA" /> 
</element> 
<!-- ... --> 

生成的文件可以被下載爲XML plugin archive。打開XML.jar並瀏覽至xml/completion目錄。它的語法是在xml-completion-info.dtd中定義的。

任務代碼不包含顯式許可證,但至少是GPL。無論如何,你可能不需要分配這個任務,只使用它,這不需要任何許可證。

我無法評估生成的xml文件的可用性,但jEdit使用它來自動完成。

4

要完成沙洛姆的答案,在哪裏添加ivy.jar的IntelliJ IDEA的社區版的位置是INTELLIJ_HOME/lib目錄/ ANT/LIB(多了一個文件夾中去)。

也許它也適用於完整版本。