Search code examples
jakarta-eemaven-2mavenradmaven-eclipse-plugin

Maven 2: eclipse-plugin to generate EAR's dependent projects to .project file


I'm trying to generate eclipse-project files using Maven2 eclipse-plugin for RAD7.5. All is going well except for the dependencies in the EAR's .project file.

When I run mvn eclipse:eclipse on a clean maven project, I come up with an EAR such as this:

<projectDescription>
  <name>MyEAR</name>
  <comment>The .project file of MyEAR</comment>
  <projects/>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.wst.common.project.facet.core.builder</name>
    </buildCommand>
    <buildCommand>
      <name>org.eclipse.wst.validation.validationbuilder</name>
    </buildCommand>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
    </buildCommand>
    <buildCommand>
      <name>com.ibm.etools.validation.validationbuilder</name>
    </buildCommand>
    <buildCommand>
      <name>com.ibm.sse.model.structuredbuilder</name>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  </natures>
</projectDescription>

BUT I want to be coming out with something like this:

<projectDescription>
  <name>MyEAR</name>
  <comment>The .project file of MyEAR</comment>
    <projects>
        <project>MyProjectConnector</project>
        <project>MYProjectEJB</project>
        <project>MyProjectDependents</project>
        <project>MyProjectLOG</project>
    </projects>
...
</projectDescription>

RAD7.5 don't understand the project structure unless the dependent projects are listed in the < projects >. But how do I do that with the eclipse-plugin? Where in the pom do I list the dependent projects, so they appear in the .project-file as < projects >?

Edit>> Here's the maven-eclipse-plugin config of my pom-file

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>false</downloadJavadocs>
                    <wtpversion>1.5</wtpversion>
                    <packaging>ear</packaging>
                </configuration>
            </plugin>
        </plugins>
        <finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
</build>

<

EDIT2: I must add that the projects builds ok, i.e. mvn clean install works fine, so basically the problem is with the eclipse plugin configuration.

EDIT3: The maven-project is built in the following fashion:

MyEAR-reactor-build
|-- pom.xml
|-- MyEAR
|   |-- pom.xml
|-- MYProjectEJB
|   |-- pom.xml
`-- . . .

ALL HELP GREATLY APPRECIATED!!! (thanks for reading this far :)


Solution

  • Ahh...thanks everybody for the help. The problem turned out to be that higher in the pom hierarchy, another developer had introduced the eclipse-plugin with the element:

    <useProjectReferences>false</useProjectReferences>
    

    For some reason having set this to true in my pom didn't override the parent setting. A bug at the eclipse-plugin, perhaps? Anyway, after setting this to true at the parent pom, all worked out. Thanks everybody for help!