別のプロジェクトの他の Java クラスに依存するプロジェクトがあります。Eclipse では、2 つのプロジェクトがエラーなしで実行されています。
ここで、Jenkins と Ant に依存するプロジェクトをビルドしたいと思います。
この構成で Ivy から依存関係を取得します。
<publications>
<artifact name="${version.name}" type="war" ext="war"/>
</publications>
<dependencies>
<dependency org="de.company.sh" name="rest-db" rev="latest.integration"/>
</dependencies>
build.xml での取得:
<!-- 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>
Jenkins のコンソール ログ:
[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 ...
この時点まではすべて問題ありません
しかし、現在、war ファイルからクラス ファイルをインクルードできないという問題があります。war ファイルから関連するクラス ファイルまでのフォルダー構造: rest-db-1.0.3269.war\WEB-INF\classes\de\company\sh...
これが私の試みですが、成功しませんでした:-(
<!-- 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>
-->
あなたが私に素晴らしい提案をしてくれることを願っています:-)