You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stefan Arentz <st...@gmail.com> on 2006/06/07 13:41:24 UTC

Maven-EAR-Plugin - Including an EJB client in an EAR mystery

I'm have a couple of projects that generate EAR files. These EARs are
not dependent on eachother and this works just fine.

However, now I want to include an EJB client jar from EAR 1 in EAR 2.
I can't find the right recipe to make this work.

I have this:

Project 1: Generates a project1.ear and an project1-ejb-1.0-client.jar
as artifacts.

Project 2: Tries to include project1-ejb-1.0-client.jar in the following manner:

<project>
   <groupId>project2</groupId>
   <artifactId>project2-ear</artifactId>
   <packaging>ear</packaging>

   <dependencies>
     <dependency>
        <groupId>project1</groupId>
        <artifactId>project1-ejb</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>ejb-client</type>
     </dependency>
   </dependencies>

  <build>
    <finalName>project2-${project.version}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <displayName>Project2</displayName>
          <description>Project2</description>
          <version>5</version>
            <modules>
              <webModule>
                 <groupId>project2</groupId>
                 <artifactId>project2-war</artifactId>
                 <contextRoot>/foo</contextRoot>
              </webModule>
              <javaModule>
                 <groupId>project1</groupId>
                 <artifactId>project1-ejb</artifactId>
                 <includeInApplicationXml>true</includeInApplicationXml>
              </javaModule>
            </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

The error I'm getting is:

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Artifact[project1:project1-ejb:jar] is not a dependency of the project.

Is this a shortcoming of the maven-ear-plugin maybe? In that it does
not recognize ejb-client as a module type?

 S.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Stephane Nicoll <st...@gmail.com>.
Nice.

If you have ideas to improve the docs, let us know.

s/

On 6/7/06, Stefan Arentz <st...@gmail.com> wrote:
> On 6/7/06, Roland Asmann <Ro...@cfc.at> wrote:
> > There's an <ejbClientModule>??? I haven't used ejb-client so far (only ejb), but at least I wasn't that far off! ;-)
>
> :-)
>
> A beer if you can find it in the documentation. (Mhuahahahahahahahaha)
>
>  S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
.::You're welcome ::.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Stefan Arentz <st...@gmail.com>.
On 6/7/06, Roland Asmann <Ro...@cfc.at> wrote:
> There's an <ejbClientModule>??? I haven't used ejb-client so far (only ejb), but at least I wasn't that far off! ;-)

:-)

A beer if you can find it in the documentation. (Mhuahahahahahahahaha)

 S.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Roland Asmann <Ro...@cfc.at>.
There's an <ejbClientModule>??? I haven't used ejb-client so far (only ejb), but at least I wasn't that far off! ;-)

Roland



On Wednesday 07 June 2006 15:28, Stefan Arentz wrote:
> On 6/7/06, Roland Asmann <Ro...@cfc.at> wrote:
> > The problem is the fact that you try to add it as a JAR (<javaModule>),
> > but you have a dependency on it as an ejb-client
> > (<type>ejb-client</type>).
> > Should it be just a jar, then you should remove the <type>, if it should
> > be an EJB, replace <javaModule> with <ejbModule>.
>
> Ok I have the right solution.
>
> Keep the dependency type set to 'ejb-client'.
>
> Then use:
>
> <ejbClientModule>
>    <groupId>project1</groupId>
>    <artifactId>project1-ejb</artifactId>
>    <includeInApplicationXml>true</includeInApplicationXml>
> </ejbClientModule>
>
> Maybe we should start a paypal fund and get someone to write real
> documentation. Little things like this take hours to figure out. Big
> waste of time.
>
>  S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Stephane Nicoll <st...@gmail.com>.
You don't need to configure it to be included in the application.xml
since it's an ejb-client. Declaring it as a dependency is enough.
http://maven.apache.org/plugins/maven-ear-plugin/howto.html

s/


On 6/7/06, Stefan Arentz <st...@gmail.com> wrote:
> On 6/7/06, Roland Asmann <Ro...@cfc.at> wrote:
> > The problem is the fact that you try to add it as a JAR (<javaModule>), but you have a dependency on it as
> > an ejb-client (<type>ejb-client</type>).
> > Should it be just a jar, then you should remove the <type>, if it should be an EJB, replace <javaModule> with
> > <ejbModule>.
>
> Ok I have the right solution.
>
> Keep the dependency type set to 'ejb-client'.
>
> Then use:
>
> <ejbClientModule>
>    <groupId>project1</groupId>
>    <artifactId>project1-ejb</artifactId>
>    <includeInApplicationXml>true</includeInApplicationXml>
> </ejbClientModule>
>
> Maybe we should start a paypal fund and get someone to write real
> documentation. Little things like this take hours to figure out. Big
> waste of time.
>
>  S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
.::You're welcome ::.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Stefan Arentz <st...@gmail.com>.
On 6/7/06, Roland Asmann <Ro...@cfc.at> wrote:
> The problem is the fact that you try to add it as a JAR (<javaModule>), but you have a dependency on it as
> an ejb-client (<type>ejb-client</type>).
> Should it be just a jar, then you should remove the <type>, if it should be an EJB, replace <javaModule> with
> <ejbModule>.

Ok I have the right solution.

Keep the dependency type set to 'ejb-client'.

Then use:

<ejbClientModule>
   <groupId>project1</groupId>
   <artifactId>project1-ejb</artifactId>
   <includeInApplicationXml>true</includeInApplicationXml>
</ejbClientModule>

Maybe we should start a paypal fund and get someone to write real
documentation. Little things like this take hours to figure out. Big
waste of time.

 S.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven-EAR-Plugin - Including an EJB client in an EAR mystery

Posted by Roland Asmann <Ro...@cfc.at>.
The problem is the fact that you try to add it as a JAR (<javaModule>), but you have a dependency on it as
an ejb-client (<type>ejb-client</type>).
Should it be just a jar, then you should remove the <type>, if it should be an EJB, replace <javaModule> with
<ejbModule>.

Roland



On Wednesday 07 June 2006 13:41, Stefan Arentz wrote:
> I'm have a couple of projects that generate EAR files. These EARs are
> not dependent on eachother and this works just fine.
>
> However, now I want to include an EJB client jar from EAR 1 in EAR 2.
> I can't find the right recipe to make this work.
>
> I have this:
>
> Project 1: Generates a project1.ear and an project1-ejb-1.0-client.jar
> as artifacts.
>
> Project 2: Tries to include project1-ejb-1.0-client.jar in the following
> manner:
>
> <project>
>    <groupId>project2</groupId>
>    <artifactId>project2-ear</artifactId>
>    <packaging>ear</packaging>
>
>    <dependencies>
>      <dependency>
>         <groupId>project1</groupId>
>         <artifactId>project1-ejb</artifactId>
>         <version>1.0-SNAPSHOT</version>
>         <type>ejb-client</type>
>      </dependency>
>    </dependencies>
>
>   <build>
>     <finalName>project2-${project.version}</finalName>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-ear-plugin</artifactId>
>         <configuration>
>           <displayName>Project2</displayName>
>           <description>Project2</description>
>           <version>5</version>
>             <modules>
>               <webModule>
>                  <groupId>project2</groupId>
>                  <artifactId>project2-war</artifactId>
>                  <contextRoot>/foo</contextRoot>
>               </webModule>
>               <javaModule>
>                  <groupId>project1</groupId>
>                  <artifactId>project1-ejb</artifactId>
>                  <includeInApplicationXml>true</includeInApplicationXml>
>               </javaModule>
>             </modules>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>
> </project>
>
> The error I'm getting is:
>
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Artifact[project1:project1-ejb:jar] is not a dependency of the
> project.
>
> Is this a shortcoming of the maven-ear-plugin maybe? In that it does
> not recognize ejb-client as a module type?
>
>  S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org