セットアップしようとしているものと同様の構成があると思います。[設定] > [Ivy] > [クラスパス] ペインで [ワークスペースの依存関係を解決する] がオンになっていることを確認してください。
以下のセットアップでは、WarProject を Tomcat に追加すると、WarProject ノードに [+] リンクが表示され、それを展開すると JarProject ノードが表示されます。パブリッシュすると、Tomcat のパブリッシュ ディレクトリに追加さJarProject.jar
れた jar ファイルが表示されます。このディレクトリは、私のワークスペース ディレクトリの下にあります。ivy.xml
wtpwebapps/WarProject/WEB-INF/lib
.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jar プロジェクトの .settings/org.eclipse.wst.common.project.facet.core.xml:
<faceted-project>
<fixed facet="jst.java" />
<fixed facet="jst.utility" />
<installed facet="jst.java" version="1.6" />
<installed facet="jst.utility" version="1.0" />
</faceted-project>
Jar プロジェクトの .settings/org.eclipse.wst.common.component:
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="JarProject">
<wb-resource deploy-path="/" source-path="/src" />
<wb-resource deploy-path="/" source-path="/resources" />
</wb-module>
</project-modules>
Jar プロジェクトの ivy.xml:
<ivy-module
version="2.0"
xmlns:m="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info module="JarProject" organisation="org.whatever" revision="${revision}" />
<configurations>
<conf name="local" visibility="private"
description="Artifacts necessary for local development and testing" />
<conf name="master" />
<conf name="sources" />
</configurations>
<publications>
<artifact ext="pom" type="pom" />
<artifact ext="jar" type="jar" conf="master" />
<artifact ext="jar" type="source" conf="sources" m:classifier="sources" />
</publications>
<dependencies defaultconfmapping="*->master(default),runtime()">
<dependency org="org.jdom" name="jdom" rev="1.0" conf="master" />
<dependency org="junit" name="junit-dep" rev="4.9" conf="local" />
</dependencies>
</ivy-module>
War プロジェクトの .settings/org.eclipse.wst.common.project.facet.core.xml:
<faceted-project>
<fixed facet="jst.java" />
<fixed facet="jst.web" />
<installed facet="jst.java" version="1.6" />
<installed facet="jst.web" version="2.5" />
<runtime name="Apache Tomcat v6.0" />
War プロジェクトの .settings/org.eclipse.wst.common.component:
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="WarProject">
<property name="context-root" value="WarProject" />
<wb-resource deploy-path="/" source-path="/WebContent" />
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src" />
<wb-resource deploy-path="/WEB-INF/classes" source-path="/resources" />
</wb-module>
</project-modules>
War プロジェクトの .classpath:
<classpath>
<classpathentry kind="output" path="bin" />
<classpathentry kind="src" path="src" />
<classpathentry kind="src" path="resources" />
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="owner.project.facets" value="jst.java" />
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web" />
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&confs=local&ivySettingsPath=%24%7Bworkspace_loc%3AWarProject%2Fivysettings.xml%7D&loadSettingsOnDemand=false&propertyFiles=" />
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&confs=master&ivySettingsPath=%24%7Bworkspace_loc%3AWarProject%2Fivysettings.xml%7D&loadSettingsOnDemand=false&propertyFiles=">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib" />
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container" />
</classpath>
War プロジェクトの ivy.xml:
<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 module="WarProject" organisation="org.whatever" revision="${revision}" />
<configurations>
<conf name="local" visibility="private"
description="Artifacts necessary for local development and testing" />
<conf name="master" />
</configurations>
<dependencies defaultconfmapping="*->master(default),runtime()">
<dependency org="org.whatever" name="JarProject" rev="latest.integration" changing="true" conf="master" />
<!-- and other dependencies of the war project -->
</dependencies>
</ivy-module>
org.eclipse.jst.component.dependency
また、Ivy クラスパス コンテナーのクラスパス エントリで属性を省略し、代わりに次のorg.eclipse.wst.common.component
ようにファイルに追加できることもわかりました。
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/con/org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&confs=master&ivySettingsPath=%24%7Bworkspace_loc%3AWarProject%2Fivysettings.xml%7D&loadSettingsOnDemand=false&propertyFiles=">
<dependency-type>consumes</dependency-type>
</dependent-module>
しかし、この代替案では、ivy.xml を変更して解決を実行すると、デプロイされた Web アプリケーションがうまく更新されませんでした。また、Ivy への URL パラメーターへの変更は、2 つのファイルとの同期を維持する必要がありました。そうしないと、デプロイ アセンブリには何も影響しません。
UI からこれらすべてを設定する方法がわかりません...