我想在集成开发环境(Intellij iDEA)中的xml编辑器中创建Ivy Ant任务,并使用基于xsd的自动完成功能,但是我找不到用于注册XML命名空间xmlns:ivy="antlib:org.apache.ivy.ant“的xsd。
在哪里可以找到它?
发布于 2016-04-28 13:12:30
可能是这样,在过去的讨论开始时没有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"
>
<!-- … -->发布于 2011-03-04 22:32:12
我刚刚将常春藤jar复制到INTELLIJ_HOME/lib/ant,现在intellij可以解决常春藤任务了。
或者将这个ant文件导入到您的ant项目中,这实际上是ivy文档中的第一个ivy示例,请确保始终依赖于install-ivy目标,在ant build窗口中将ant文件添加到idea中,这样您甚至不必安装ivy,idea就可以识别ivy任务。
<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>
发布于 2013-03-21 04:27:01
为了完成沙洛姆的回答,为IntelliJ IDEA社区版添加ivy.jar的位置是INTELLIJ_HOME/lib/ant/lib (还有一个文件夹)。
也许它也适用于完整版。
https://stackoverflow.com/questions/4897672
复制相似问题