Hi,

Using separate module for EAR is the most useful solution.
This module is description of "what must be in the ear".
Use <packaging>ear</packaging>, <modules> section in the <configuration> and, attention, don't forget add dependency to project-web artifact to <dependencies> section.

Like below:

<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="..."
 xsi:schemaLocation="...">
 <modelVersion>4.0.0</modelVersion>
 <groupId>my.project</groupId>
 <artifactId>project-ear</artifactId>
 <packaging>ear</packaging>
 <version>SNAPSHOT</version>
 <name>My Project</name>
 <build>
   <plugins>
     ...
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-ear-plugin</artifactId>
<configuration> <modules>
              <webModule>
                <groupId>my.project</groupId>
                <artifactId>project-web</artifactId>
                <bundleFileName>project-web.war</bundleFileName>
              </webModule>
           </modules>
           
<applicationXml>src/main/resources/META-INF/application.xml</applicationXml>
       </configuration>
     </plugin>
   </plugins>
 </build>
 <dependencies>
   ...
        <dependency>
           <groupId>my.project</groupId>
            <artifactId>project-web</artifactId>
<version>SNAPSHOT</version> </dependency> </dependencies>
</project>

Belive, it will help your.

Best regards,
Aleksey Didik




Joerg Heinicke пишет:
Hi,

I'm trying to create an EAR from my WAR file. The WAR itself works perfectly.
Now I expected ear:ear will simply create my EAR file. (It is supposed to
consist only of this one web module.) Unfortunately the WAR is exploded in the
EAR's root.

I searched in the archives but it seems people usually want to have it the other
way around. I also tried configuring the ear plugin by declaring the web module

  <modules>
    <webModule>
      <groupId>my.project</groupId>
      <artifactId>project-web</artifactId>
      <bundleFileName>project-web.war</bundleFileName>
    </webModule>
  </modules>

Now it chokes on missing dependency on the project-web artifact. Does that mean
I need a separate project just for the EAR?

My pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="..."
  xsi:schemaLocation="...">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my.project</groupId>
  <artifactId>project-web</artifactId>
  <packaging>war</packaging>
  <version>SNAPSHOT</version>
  <name>My Project</name>
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
<applicationXml>src/main/resources/META-INF/application.xml</applicationXml>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    ...
  </dependencies>
</project>

Any ideas?
Thanks in advance,
Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to