我有一个像这样的多个 Maven 项目:
root/
----war
----jar1
----jar2
----jar3
战争使用jar1、jar2和jar3
当我运行“mvn clean install”时,编译好的战争很好并且在我的服务器(jboss)中工作正常。当我运行“mvn eclipse:eclipse”来生成我的 eclipse 配置时,构建工作但是当我在 eclipse (Indigo) 中导入我的项目并在我的服务器中发布我的战争时,jar1、jar2、jar3 没有发布。
在war构建路径配置中,jar1、jar2、jar3都配置好了。
但是当我查看 war 项目的部署程序集时,出现了下一个错误:
这是我为 war 项目生成的 .classpath 文件:
<classpath>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="var" path="M2_REPO/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13.jar" sourcepath="M2_REPO/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13-sources.jar">
<attributes>
<attribute value="jar:file:/Users/Kiva/java/repoMaven/javax/faces/jsf-api/1.2_13/jsf-api-1.2_13-javadoc.jar!/" name="javadoc_location"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_13/jsf-impl-1.2_13.jar" sourcepath="M2_REPO/javax/faces/jsf-impl/1.2_13/jsf-impl-1.2_13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar" sourcepath="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar" sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar">
<attributes>
<attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/jar1"/>
<classpathentry kind="src" path="/jar2"/>
<classpathentry kind="src" path="/jar3"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE-sources.jar">
<attributes>
<attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
</attributes>
</classpathentry>
</classpath>
这是我的eclipse插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
我不明白为什么我的插件配置有问题以及为什么eclipse找不到jar。
谢谢你的帮助。