我相信我们有一个类似的配置你是什么难以释怀克设置。确保在“首选项”>“Ivy”>“类路径”窗格中选中了“解决工作区中的依赖关系”。
与下面的设置,增加WarProject到Tomcat的时候,你应该看到WarProject节点上的[+]链接,并扩大它应该显示JarProject节点。发布时,你应该看到JarProject.jar
任何广口瓶定义在它的ivy.xml
加入wtpwebapps/WarProject/WEB-INF/lib
Tomcat的发布目录,这对我来说是在.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>
罐项目的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>
战项目的.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" />
战项目的.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>
战项目的.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>
战项目的常春藤.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
属性在常春藤类路径容器中的类路径条目,而是把它添加到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并运行解决方案,那么部署的webapp并未更新得非常好。此外,对Ivy的URL参数所做的任何更改都需要与这两个文件保持同步,否则将无助于部署程序集。
不知道如何通过UI设置这一切了......
感谢您抽出宝贵时间来帮助。这并不是我所期待的,我并不真的需要IvyDE来为我做一个解决方案,在本地缓存中引用它们并没有问题,WTP部署将从IvyDE创建的库中部署它们。问题是'modules'项目引用的库将被部署在WTP为'modules'项目创建的jar中,而不是'web'项目的WAR-WEB-INF/lib中。我试图找到一个解决方案,不需要我将'module'项目合并到'web'项目中,只是为了让WTP部署工作。 – Victor 2012-01-25 21:13:08