ant ivy lib“antlib:org.apache.ivy.ant”的 xsd 位置(用于使用 xsd 进行 IDE 自动完成)?

2024-01-08

我想在 IDE (Intellij iDEA) 的 xml 编辑器中创建 Ivy Ant 任务,并基于 xsd 自动完成,但我找不到用于注册 XML 命名空间 xmlns:ivy="antlib:org.apache.ivy.ant" 的 xsd

我在哪里可以找到它?


我刚刚将 ivy jar 复制到 INTELLIJ_HOME/lib/ant,现在 intellij 可以解决 ivy 任务。

或者将此ant文件导入到您的ant项目中,它实际上是ivy文档中的第一个ivy示例,请确保始终依赖于install-ivy目标,将您的ant文件添加到ant构建窗口中的idea中,您甚至不必安装ivy IDEA 识别常春藤任务。

<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>    
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ant ivy lib“antlib:org.apache.ivy.ant”的 xsd 位置(用于使用 xsd 进行 IDE 自动完成)? 的相关文章

随机推荐