Search code examples
eclipsemavenmaven-eclipse-plugin

Multiple maven projects in eclipse Indigo


I have a multiple maven project like this:

root/
----war
----jar1
----jar2
----jar3

The war use jar1, jar2 and jar3

When I run a "mvn clean install", the compiled war is good and work fine in my server (jboss). When I run a "mvn eclipse:eclipse" to generate my eclipse configuration, the build works but when I import my projects in eclipse (Indigo) and I publish my war in my server, jar1, jar2, jar3 are not publish.

In the war build path configuration, jar1, jar2, jar3 are well configured.

enter image description here

But when I look at the deployment assembly for the war project, I have the next error:

enter image description here

Here is my generated .classpath file for the war project:

<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>

Here is my eclipse plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-eclipse-plugin</artifactId>
    <configuration>
        <wtpversion>2.0</wtpversion>
        </configuration>
</plugin>

I don't understand why it's wrong in my plugin configuration and why eclipse doesn't find jars.

Thanks for your help.


Solution

  • I have found the problem.

    The jboss tools maven support plugin (install with jboss tools) break the link between projects. Uninstalling it will solve the problem.

    It's possible to uninstall just the maven support and keep the rest ;)