使用以下内容ivy.xml
:
<dependency org="com.amazonaws" name="aws-java-sdk" rev="1.4.5">
<artifact name="aws-java-sdk" ext="jar"/>
</dependency>
它下载aws-java-sdk-1.4.5.jar
,这是 AWS 开发工具包,即类。
这很好,但我也想获得 Javadoc 和源代码。
遵循Ivy 的建议:获取 Javadocs 和源代码我将以下内容放入ivy.xml
<configurations>
<conf name="default" />
<conf name="compile" visibility="public"/>
<conf name="sources" visibility="public"/>
<conf name="javadoc" visibility="public"/>
</configurations>
<dependency org="com.amazonaws" name="aws-java-sdk"
rev="1.4.5" transitive="true"
conf="javadoc->javadoc;sources->sources;compile->default"/>
aws-java-sdk-1.4.5.jar
它只下载,它是Javadoc(没有类或源文件)。
更新:可能有用的文件片段
构建.xml
<project name="aws-project" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="build" depends="clean,configure-ivy-settings,artifactory-retrieve">
常春藤配置.xml
<project name="artifactory-bootstrap" xmlns:ac="http://ant-contrib.sourceforge.net" xmlns:ivy="antlib:org.apache.ivy.ant" default="configure-ivy-settings">
<target name="configure-ivy-settings" unless="skip.artifact.retrieve">
<echoproperties prefix="ivy" />
<!-- Change this to point to the branch in artifactory -->
<property name="artifactory.branch" value="20.0" />
<!-- Change this to the SRCROOT of your build -->
<property name="build.srcroot" value="${bootstrap.basedir}" />
<!-- Configure IVY Settings -->
<ivy:settings url="https://artifactory.mycompany.com/artifactory/simple/bootstrap/${artifactory.branch}/ivysetting-artifactory.xml" id="artifactory.ivy.settings" host="artifactory.mycompany.com" realm="Artifactory Realm" username="${artifactory.user}" passwd="${artifactory.password}" />
</target>
<target name="artifactory-retrieve" unless="skip.artifact.retrieve">
<property name="download.dir" value="${bootstrap.basedir}/extlib" />
<delete dir="${download.dir}" />
<mkdir dir="${download.dir}" />
<ivy:resolve settingsRef="artifactory.ivy.settings" file="${ivy.file}" />
<ivy:cachefileset settingsRef="artifactory.ivy.settings" setid="latest.downloads" />
<echo message="Artifacts are available at : ${download.dir}" />
<copy flatten="true" todir="${download.dir}">
<fileset refid="latest.downloads" />
</copy>
<fileset id="ivy.fileset" dir="${download.dir}">
<include name="*.jar" />
</fileset>
<property name="ivy.downloads.fileset" refid="ivy.fileset" />
<!-- Construct classpath to downloads //-->
<path id="ivy.classpath">
<fileset dir="${download.dir}">
<include name="*.jar" />
</fileset>
</path>
<property name="ivy.downloads.classpath" refid="ivy.classpath" />
<echo message="ivy.downloads.classpath=${ivy.downloads.classpath}"/>
<echo message="Artifacts are available at : ${download.dir}" />
<echo message="They can be referenced using fileset refid ivy.downloads.fileset or ivy.downloads.classpath" />
</target>