Nathan,
Thanks for quick reply. I tried and it worked. I was refering to documents on
Maven forum which it appears are obsolete. I am very close to packaging an ear file. However, another error is thrown in the following script of ear generation project.
Here is pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acme</groupId>
<artifactId>apps</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>psmear</artifactId>
<name>psm ear packaging</name>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.1</version>
<configuration>
<displayName>PSM Project Enterprise Archive</displayName>
<description>includes EJBS, Apps and War file</description>
<earSourceDirectory>EarContent</earSourceDirectory>
<defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>
<modules>
<javaModule>
<groupId>com.acme</groupId>
<artifactId>core</artifactId>
</javaModule>
<javaModule>
<groupId>com.acme</groupId>
<artifactId>product</artifactId>
</javaModule>
<ejb3Module>
<groupId>com.acme</groupId>
<artifactId>handlermessagebean</artifactId>
<bundleFileName>handlermessagebean.ejb3</bundleFileName>
</ejb3Module>
<ejb3Module>
<groupId>com.acme</groupId>
<artifactId>interfacemessagebean</artifactId>
<bundleFileName>interfacemessagebean.ejb3</bundleFileName>
</ejb3Module>
<ejb3Module>
<groupId>com.acme</groupId>
<artifactId>persistencemessagebean</artifactId>
<bundleFileName>persistencemessagebean.ejb3</bundleFileName>
</ejb3Module>
<ejb3Module>
<groupId>com.acme</groupId>
<artifactId>productmessagebean</artifactId>
<bundleFileName>productmessagebean.ejb3</bundleFileName>
</ejb3Module>
<ejb3Module>
<groupId>com.acme</groupId>
<artifactId>urlharvestermessagebean</artifactId>
<bundleFileName>urlharvestermessagebean.ejb3</bundleFileName>
</ejb3Module>
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>product</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>interfacemessagebean</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>handlermessagebean</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>persistencemessagebean</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>productmessagebean</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.acme</groupId>
<artifactId>urlharvestermessagebean</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
and Here is the exception stack.
[INFO] Trace
org.apache.maven.BuildFailureException: Artifact[com.acme:handlermessagebean:ejb3] is not a dependency of the project.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:560)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: Artifact[com.acme:handlermessagebean:ejb3] is not a dependency of the project.
at org.apache.maven.plugin.ear.AbstractEarModule.resolveArtifact(AbstractEarModule.java:98)
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:98)
at org.apache.maven.plugin.ear.GenerateApplicationXmlMojo.execute(GenerateApplicationXmlMojo.java:96)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Thanks once again for your help.