You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Darmont (JIRA)" <ji...@codehaus.org> on 2009/02/16 14:57:19 UTC

[jira] Created: (MECLIPSE-526) MyEclipse : Bad generation of .metadata file for an EAR project

MyEclipse : Bad generation of .metadata file for an EAR project
---------------------------------------------------------------

                 Key: MECLIPSE-526
                 URL: http://jira.codehaus.org/browse/MECLIPSE-526
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: MyEclipse support
    Affects Versions: 2.5.1
         Environment: WinXP, Sun JVM 1.5.0_14, Eclipse 3.3.x, MyEclipse 6.0.x
            Reporter: Guillaume Darmont
         Attachments: MyEclipseMetadataWriter.java

The file .metadata of an EAR project does not contains reference to WAR and/or EJB modules.

I attached a patched "MyEclipseMetadataWriter.java" file that takes care of the maven-ear-plugin part of an EAR pom.xml to generate a working .metadata file.

The following pom.xml
{code:xml}
...
  <packaging>ear</packaging>
  <name>[${packaging}] ${artifactId}</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <displayName>MyApp</displayName>
          <modules>
            <webModule>
              <groupId>${groupId}</groupId>
              <artifactId>my-webapp2</artifactId>
              <contextRoot>/mywebapp</contextRoot>
            </webModule>
            <webModule>
              <groupId>${groupId}</groupId>
              <artifactId>my-webapp2</artifactId>
              <contextRoot>/mywebapp</contextRoot>
            </webModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>
...
{code}

now generates 

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<enterprise-project version="1.0.0" name="my-app" id="my-app" archive="my-app.ear">
  <project-modules>
    <project-module type="WEB" name="mywebapp" id="mywebapp" j2ee-spec="1.4" archive="mywebapp.war" context-root="/mywebapp">
      <attributes>
        <attribute name="webrootdir" value="src/main/webapp"/>
      </attributes>
    </project-module>
    <project-module type="WEB" name="mywebapp2" id="mywebapp2" j2ee-spec="1.4" archive="mywebapp2.war" context-root="/mywebapp2">
      <attributes>
        <attribute name="webrootdir" value="src/main/webapp"/>
      </attributes>
    </project-module>
  </project-modules>
</enterprise-project>
{code}

Hope this help.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira