我使用ant和ivy创建jar文件,我有6个罐子,我正在复制到$ {build.google.reports.jars.dir}目录。这些是静态文件,但我想通过IVY获取。
我已经尝试过常春藤安装和检索,但没有运气。如何从常春藤缓存或任何其他更好的解决方案复制到$ {build.jar.file} jar文件?
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="google" module="google-utils" status="integration"/>
<dependencies>
<dependency org="log4j" name="apache-log4j-extras" rev="1.0"/>
<dependency org="commons-cli" name="commons-cli" rev="1.2"/>
<dependency org="dom4j" name="dom4j" rev="1.5.2" />
<dependency org="jaxen" name="jaxen" rev="1.1.3"/>
<dependency org="log4j" name="log4j" rev="1.2.16" />
<dependency org="net.sf.staf" name="jstaf" rev="3.4.4"/>
</dependencies>
</ivy-module>
<project name="google-utils" default="jar" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<import file="../google-global.xml"/>
<property name="build.google.dir" location="${build.dir}/google"/>
<property name="build.google.jars.dir" location="${build.google.dir}/STAF-INF/jars"/>
<property name="build.google.classes.dir" location="${build.google.dir}/STAF-INF/classes"/>
<property name="build.google.reports" location="${build.google.dir}/reports" />
<property name="build.google.reports.classes.dir" location="${build.google.reports}/STAF-INF/classes"/>
<property name="build.google.reports.jars.dir" location="${build.google.reports}/STAF-INF/jars"/>
<property name="build.jar.file" location="${dist.dir}/googleResults.jar"/>
<target name="jar" depends="google-reports" description="Default target to create jar file"/>
<target name="google-reports" depends="compile" description="Creates google jar file">
<copy todir="${build.google.reports.jars.dir}">
<fileset dir="jars">
<include name="apache-log4j-extras-1.0.jar" />
<include name="commons-cli-1.2.jar" />
<include name="dom4j-1.5.2.jar" />
<include name="jaxen-1.1.3.jar" />
<include name="log4j-1.2.16.jar" />
<include name="jstaf-3.4.4.jar" />
</fileset>
</copy>
<copy todir="${build.google.reports.classes.dir}">
<fileset dir="${build.classes.dir}" />
</copy>
<jar destfile="${build.jar.file}" basedir="${build.google.reports}">
<manifest>
<attribute name="Main-Class" value="google.Driver" />
<section name="google/service/info">
<attribute name="Service-Class" value="com.google.reports.ResultsGoogle" />
<attribute name="Packaged-Jars" value="apache-log4j-extras-1.0 commons-cli-1.2 dom4j-1.5.2 jaxen-1.1.3 log4j-1.2.16 jstaf-3.4.4"/>
</section>
</manifest>
</jar>
</target>
</project>
答案 0 :(得分:0)
您必须使用常春藤:安装并将* .jar复制到目标目录:
<ivy:install organisation="log4j" module="apache-log4j-extras" revision="1.0" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="commons-cli" module="commons-cli" revision="1.2" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="dom4j" module="dom4j" revision="1.5.2" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="jaxen" module="jaxen" revision="1.1.3" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="log4j" module="log4j" revision="1.2.16" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="net.sf.staf" module="jstaf" revision="3.4.4" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<copy todir="${build.staf.bugreports.jars.dir}">
<fileset dir="${build.tmp.dir}">
<include name="*.jar"/>
</fileset>
</copy>
<delete dir="${build.tmp.dir}"/>