Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant Build:从类文件夹中的常春藤依赖项war文件中提取类文件_Ant_Jenkins_Build Process_Ivy - Fatal编程技术网

Ant Build:从类文件夹中的常春藤依赖项war文件中提取类文件

Ant Build:从类文件夹中的常春藤依赖项war文件中提取类文件,ant,jenkins,build-process,ivy,Ant,Jenkins,Build Process,Ivy,我有一个项目依赖于另一个项目中的其他Java类。 在eclipse中,这两个项目运行时没有任何错误 现在我想用Jenkins和Ant的依赖关系来构建这个项目 我使用以下配置从Ivy获取依赖项: 到目前为止一切正常 但是现在我有一个问题,我不能包含war文件中的类文件。 从war文件到相关类文件的文件夹结构: rest-db-1.0.3269.war\WEB-INF\classes\de\company\sh 以下是我的尝试,但没有成功:-( 我希望你能给我一些绝妙的建议:-)听起来

我有一个项目依赖于另一个项目中的其他Java类。 在eclipse中,这两个项目运行时没有任何错误

现在我想用Jenkins和Ant的依赖关系来构建这个项目

我使用以下配置从Ivy获取依赖项:

到目前为止一切正常

但是现在我有一个问题,我不能包含war文件中的类文件。 从war文件到相关类文件的文件夹结构: rest-db-1.0.3269.war\WEB-INF\classes\de\company\sh

以下是我的尝试,但没有成功:-(




我希望你能给我一些绝妙的建议:-)

听起来你想在一个已经使用ivy下载的工件中声明对工件的依赖

也许您需要查看packager解析器。功能强大,但安装有点复杂

有关示例,请参见:

<publications>
    <artifact name="${version.name}" type="war" ext="war"/>
</publications>

<dependencies>
    <dependency org="de.company.sh" name="rest-db" rev="latest.integration"/>
</dependencies>
<!-- retrieve dependencies from ivy -->
<target name="retrieve" depends="prepare, prepare.productive, prepare.beta">
    <!-- Fetch parameters from properties -->
    <property file="build.properties" />
    <!-- Resolve module -->
    <ivy:resolve file="ivy.xml" />
    <!-- Retrieve dependencies -->
    <ivy:retrieve pattern="${build}/deps/[organization]/[module]/[artifact]-[revision].[ext]" />
</target>
[ivy:resolve] Apr 24, 2013 1:42:06 PM   org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
[ivy:resolve] INFO: Basic authentication scheme selected
[ivy:resolve] downloading    http://localhost:7080/nexus/content/repositories/snapshots/de/company/sh/rest-db/1.0.3269/wars/rest-db-1.0.3269.war ...
<!-- create war file from java classes -->
<target name="war" depends="compile">


    <!-- Move rest-db where it is needed
    <war destfile="${build}/lib/rest-db.war" webxml="WEB-INF/web.xml">
        <zipfileset dir="${build}/classes" includes="**/*.class"/>
    </war>
     -->
    <!-- -->
    <zip destfile="${build}/deps/de.company.sh/rest-db" basedir="${build}" update="true" />

    <!-- Copy all necessary Spring libraries -->
    <copy todir="${build}/lib">
        <!-- All files directly located in the lib/ directory -->
        <fileset dir="${lib}">
            <include name="*.jar" />
        </fileset>
    </copy>
    <!-- Move rest-db where it is needed
    <copy todir="${build}/classes">
        <fileset dir="${build}/deps/de.company.sh/rest-db">
            <include name="*.*" />
        </fileset>
    </copy>
     -->