You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Höller <ma...@xss.co.at> on 2008/04/23 11:08:49 UTC

problems building a multimodule project with EJB3 modules

Hi all!

I'm having problems with a multimodule project with EJB3 dependencies. It 
seems maven is not able to include EJB3 modules in the classpath of other 
child-modules when not in the local repository. The simplest project 
struture to reproduce is the following:

parent (packagin pom)
  |
  +-- child1 (packagin jar)
  |
  `-- child2 (packagin ejb)

where child1 depends on child2. When I execute "mvn package" (with an empty 
local repository) from the parent child2 is packaged and then I get a 
missing dependency in child1 on child2:


INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) at.co.xss.mhtest.multimodule:child2:jar:1.0-SNAPSHOT
[...]

However, when I execute "mvn install" instead everything compiles and 
packages fine.

The problem seems to be that maven is not able to include the classes of the 
child2 module in the classpath of child1 when it is compiling child1. When 
a "mvn install" is executed, the final jar is in the local repo and 
correctly included in the classpath, so this shows no problems.

Is this behaviour with EJB3 modules intentional, am I missing something here 
or is this a bug?

Thanks for your suggestions,
- martin



Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 23 April 2008 Daniele De Francesco wrote:
> try to swap the order of the modules first...then send the poms...

Didn't help. POMs are comming in a separate mail.

thx,
- martin

Re: problems building a multimodule project with EJB3 modules

Posted by Daniele De Francesco <dd...@gmail.com>.
Hi,

try to swap the order of the modules first...then send the poms...

Regards

--
Daniele De Francesco

On Wed, Apr 23, 2008 at 11:08 AM, Martin Höller <ma...@xss.co.at> wrote:

> Hi all!
>
> I'm having problems with a multimodule project with EJB3 dependencies. It
> seems maven is not able to include EJB3 modules in the classpath of other
> child-modules when not in the local repository. The simplest project
> struture to reproduce is the following:
>
> parent (packagin pom)
>  |
>  +-- child1 (packagin jar)
>  |
>  `-- child2 (packagin ejb)
>
> where child1 depends on child2. When I execute "mvn package" (with an
> empty
> local repository) from the parent child2 is packaged and then I get a
> missing dependency in child1 on child2:
>
>
> INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) at.co.xss.mhtest.multimodule:child2:jar:1.0-SNAPSHOT
> [...]
>
> However, when I execute "mvn install" instead everything compiles and
> packages fine.
>
> The problem seems to be that maven is not able to include the classes of
> the
> child2 module in the classpath of child1 when it is compiling child1. When
> a "mvn install" is executed, the final jar is in the local repo and
> correctly included in the classpath, so this shows no problems.
>
> Is this behaviour with EJB3 modules intentional, am I missing something
> here
> or is this a bug?
>
> Thanks for your suggestions,
> - martin
>
>
>

Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
Hi!

On Wednesday 23 April 2008 Daniele De Francesco wrote:
> didn't you use maven-jar-plugin for child1's artifact?

As you can see from the poms I didn't configure it explicitly but I'm pretty 
sure it would be called by maven when the "package" phase would be 
executed.

But it never gets so far as dependencies are resolved earlier and the EJB 
dependency is missing.

> Not sure but try setting in child1 manifest the cross dependency, should
> do the trick...

I think you misunderstood my problem. If child2 is of <type>jar</type> it 
works. If it is of <type>ejb</type> it fails with a missing dependency and 
this is IMHO a bug!

- martin

Re: problems building a multimodule project with EJB3 modules

Posted by Daniele De Francesco <dd...@gmail.com>.
Hi,

just a question?

didn't you use maven-jar-plugin for child1's artifact?
Not sure but try setting in child1 manifest the cross dependency, should do
the trick...

beside this, have you checked by changing the scope of the dependencies:
i.e.:
--8<---- [child1's pom.xml] ----------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
   http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVers
>
> ion>
>  <groupId>at.co.xss.mhtest.multimodule</groupId>
>  <artifactId>child1</artifactId>
>  <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>child1</name>
>
>  <dependencies>
>    <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>       <version>4.0</version>
>    </dependency>
>
>    <dependency>
>      <groupId>at.co.xss.mhtest.multimodule</groupId>
>      <artifactId>child2</artifactId>
>      <version>1.0-SNAPSHOT</version>
>
         *<scope>runtime</scope>*

>
>    </dependency>
>   </dependencies>
> </project>
> --8<----------------------------------------


This way compiler should be happy because it just expects the dependency to
be resolved later...

hope this helps

Regards

--
Daniele De Francesco





On Wed, Apr 23, 2008 at 12:35 PM, Martin Höller <ma...@xss.co.at> wrote:

> On Wednesday 23 April 2008 Thomas Darbois wrote:
> > Can you show us your (simplified?) pom(s)?
>
> Sure. Here we go:
>
> --8<---- [parent's pom.xml] ----------------
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>    http://maven.apache.org/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>at.co.xss.mhtest.multimodule</groupId>
>  <artifactId>parent</artifactId>
>  <packaging>pom</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>parent</name>
>
>  <modules>
>    <module>child1</module>
>    <module>child2</module>
>  </modules>
> </project>
> --8<----------------------------------------
>
> --8<---- [child1's pom.xml] ----------------
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>    http://maven.apache.org/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>at.co.xss.mhtest.multimodule</groupId>
>  <artifactId>child1</artifactId>
>  <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>child1</name>
>
>  <dependencies>
>    <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>       <version>4.0</version>
>    </dependency>
>
>    <dependency>
>      <groupId>at.co.xss.mhtest.multimodule</groupId>
>      <artifactId>child2</artifactId>
>      <version>1.0-SNAPSHOT</version>
>    </dependency>
>   </dependencies>
> </project>
> --8<----------------------------------------
>
> --8<---- [child2's pom.xml] ----------------
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>    http://maven.apache.org/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>at.co.xss.mhtest.multimodule</groupId>
>  <artifactId>child2</artifactId>
>  <packaging>ejb</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>child2</name>
>
>  <build>
>    <plugins>
>
>      <plugin>
>        <artifactId>maven-ejb-plugin</artifactId>
>        <configuration>
>          <ejbVersion>3.0</ejbVersion>
>          <generateClient>true</generateClient>
>          <archive>
>            <manifest>
>              <addClasspath>true</addClasspath>
>            </manifest>
>          </archive>
>        </configuration>
>      </plugin>
>    </plugins>
>  </build>
> </project>
> --8<----------------------------------------
>
> - martin
>

Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 23 April 2008 Thomas Darbois wrote:
> Can you show us your (simplified?) pom(s)?

Sure. Here we go:

--8<---- [parent's pom.xml] ----------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>at.co.xss.mhtest.multimodule</groupId>
  <artifactId>parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>parent</name>

  <modules>
    <module>child1</module>
    <module>child2</module>
  </modules>
</project>
--8<----------------------------------------

--8<---- [child1's pom.xml] ----------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>at.co.xss.mhtest.multimodule</groupId>
  <artifactId>child1</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>child1</name>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.0</version>
    </dependency>

    <dependency>
      <groupId>at.co.xss.mhtest.multimodule</groupId>
      <artifactId>child2</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>
</project>
--8<----------------------------------------

--8<---- [child2's pom.xml] ----------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>at.co.xss.mhtest.multimodule</groupId>
  <artifactId>child2</artifactId>
  <packaging>ejb</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>child2</name>

  <build>
    <plugins>

      <plugin>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
          <ejbVersion>3.0</ejbVersion>
          <generateClient>true</generateClient>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
--8<----------------------------------------

- martin

RE: problems building a multimodule project with EJB3 modules

Posted by Thomas Darbois <Th...@edifixio.com>.
Can you show us your (simplified?) pom(s)?

I've tried to reproduce your problem and I had no problem at all to package the 2 nd module. And I ve tried several configuration.

May be I missed something in your configuration.


-----Message d'origine-----
De : Martin Höller [mailto:martin@xss.co.at]
Envoyé : mercredi 23 avril 2008 11:09
À : Maven Users List
Objet : problems building a multimodule project with EJB3 modules

Hi all!

I'm having problems with a multimodule project with EJB3 dependencies. It
seems maven is not able to include EJB3 modules in the classpath of other
child-modules when not in the local repository. The simplest project
struture to reproduce is the following:

parent (packagin pom)
  |
  +-- child1 (packagin jar)
  |
  `-- child2 (packagin ejb)

where child1 depends on child2. When I execute "mvn package" (with an empty
local repository) from the parent child2 is packaged and then I get a
missing dependency in child1 on child2:


INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) at.co.xss.mhtest.multimodule:child2:jar:1.0-SNAPSHOT
[...]

However, when I execute "mvn install" instead everything compiles and
packages fine.

The problem seems to be that maven is not able to include the classes of the
child2 module in the classpath of child1 when it is compiling child1. When
a "mvn install" is executed, the final jar is in the local repo and
correctly included in the classpath, so this shows no problems.

Is this behaviour with EJB3 modules intentional, am I missing something here
or is this a bug?

Thanks for your suggestions,
- martin



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


Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
No one having problems with EJB3 modules in a multimodule build? Or is it 
just a bad subject?

Could someone please test the attached project and confirm that the build 
fails.

thanks,
- martin

On Monday 24 November 2008 Martin Höller wrote:
> Hi all!
>
> On 25 Apr 2008, Martin Höller wrote:
> > I'll report back when I found out more about why my complex project
> > failed with similar dependencies as the example.
>
> It's been a while, but the problem still exists and hit me again. The
> whole story can be found at
> http://www.nabble.com/problems-building-a-multimodule-project-with-EJB3-m
>odules-to16851710.html#a16891383
>
> The summary of my problem is, that I have a multi-module project where
> one module (child2) is an EJB and another module (child1) depends on this
> EJB. It declares the dependency as
>
>     <dependency>
>       <groupId>at.co.xss.mhtest.multimodule</groupId>
>       <artifactId>child2</artifactId>
>       <version>1.0-SNAPSHOT</version>
>       <type>ejb-client</type>
>     </dependency>
>
> Note the "ejb-client" type! The build of this project fails, if child2 is
> not already in the local repository.
>
> I managed to create a small sample project which is attached to this mail
> (hope it will come through). It demonstrates the problem. Just run "mvn
> test" and it will fail with
>
> ---8<---------------------
> ...
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) at.co.xss.mhtest.multimodule:child2:ejb-client:client:1.0-SNAPSHOT
>
>   Try downloading the file manually from the project website.
>
>   Then, install it using the command:
>       mvn install:install-file -DgroupId=at.co.xss.mhtest.multimodule
> -DartifactId=child2 -Dversion=1.0-SNAPSHOT -Dclassifier=client
> -Dpackaging=ejb-client -Dfile=/path/to/file
>
>   Alternatively, if you host your own repository you can deploy the file
> there: mvn deploy:deploy-file -DgroupId=at.co.xss.mhtest.multimodule
> -DartifactId=child2 -Dversion=1.0-SNAPSHOT -Dclassifier=client
> -Dpackaging=ejb-client -Dfile=/path/to/file -Durl=[url]
> -DrepositoryId=[id]
>
>   Path to dependency:
>         1) at.co.xss.mhtest.multimodule:child1:jar:1.0-SNAPSHOT
>         2)
> at.co.xss.mhtest.multimodule:child2:ejb-client:client:1.0-SNAPSHOT
>
> ----------
> 1 required artifact is missing.
> ...
> ---8<---------------------
>
> Currently I'm running maven 2.0.9.
>
> Any ideas?
>
> - martin



Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
Hi all!

On 25 Apr 2008, Martin Höller wrote:

> I'll report back when I found out more about why my complex project failed 
> with similar dependencies as the example.

It's been a while, but the problem still exists and hit me again. The
whole story can be found at
http://www.nabble.com/problems-building-a-multimodule-project-with-EJB3-modules-to16851710.html#a16891383

The summary of my problem is, that I have a multi-module project where
one module (child2) is an EJB and another module (child1) depends on this
EJB. It declares the dependency as

    <dependency>
      <groupId>at.co.xss.mhtest.multimodule</groupId>
      <artifactId>child2</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>ejb-client</type>
    </dependency>

Note the "ejb-client" type! The build of this project fails, if child2 is
not already in the local repository.

I managed to create a small sample project which is attached to this mail
(hope it will come through). It demonstrates the problem. Just run "mvn
test" and it will fail with

---8<---------------------
...
[INFO] Failed to resolve artifact.

Missing:
----------
1) at.co.xss.mhtest.multimodule:child2:ejb-client:client:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=at.co.xss.mhtest.multimodule -DartifactId=child2 -Dversion=1.0-SNAPSHOT -Dclassifier=client -Dpackaging=ejb-client -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=at.co.xss.mhtest.multimodule -DartifactId=child2 -Dversion=1.0-SNAPSHOT -Dclassifier=client -Dpackaging=ejb-client -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) at.co.xss.mhtest.multimodule:child1:jar:1.0-SNAPSHOT
        2) at.co.xss.mhtest.multimodule:child2:ejb-client:client:1.0-SNAPSHOT

----------
1 required artifact is missing.
...
---8<---------------------

Currently I'm running maven 2.0.9.

Any ideas?

- martin

Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
On Friday 25 April 2008 Wendy Smoak wrote:
> From memory, we had a project at work that had an ejb dependency, and
> without the 'type' element, the release process which runs through the
> integration-test phase would fail, while 'mvn install' would work.
> Apparently inside the reactor it was looking for type=jar rather than
> type=ejb, but if it was working off the local repo (running through
> the install phase) it would work fine.  I thought it was similar to
> your situation.

I just double-checked and noticed that I made a mistake in my example: I 
used <type>client</type> instead of <type>ejb-client</type>. With the 
correct type the provided example works now.

I'll report back when I found out more about why my complex project failed 
with similar dependencies as the example.

Thanks for your help,
- martin



Re: problems building a multimodule project with EJB3 modules

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Apr 25, 2008 at 2:25 PM, Martin Höller <ma...@xss.co.at> wrote:

>  Could you please provide some more information, Wendy.

>From memory, we had a project at work that had an ejb dependency, and
without the 'type' element, the release process which runs through the
integration-test phase would fail, while 'mvn install' would work.
Apparently inside the reactor it was looking for type=jar rather than
type=ejb, but if it was working off the local repo (running through
the install phase) it would work fine.  I thought it was similar to
your situation.

HTH,
-- 
Wendy

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


Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 23 April 2008 Wendy Smoak wrote:
> On Wed, Apr 23, 2008 at 5:08 PM, Martin Höller <ma...@xss.co.at> wrote:
> >  I'm having problems with a multimodule project with EJB3 dependencies.
> > It seems maven is not able to include EJB3 modules in the classpath of
> > other child-modules when not in the local repository. The simplest
> > project struture to reproduce is the following:
>
> This sounds familiar... what does the dependency on the EJB look like?
>  Does it have a <type>?

Could you please provide some more information, Wendy.

Many thanks,
- martin


Re: problems building a multimodule project with EJB3 modules

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 23 April 2008 Wendy Smoak wrote:
> On Wed, Apr 23, 2008 at 5:08 PM, Martin Höller <ma...@xss.co.at> wrote:
> >  I'm having problems with a multimodule project with EJB3 dependencies.
> > It seems maven is not able to include EJB3 modules in the classpath of
> > other child-modules when not in the local repository. The simplest
> > project struture to reproduce is the following:
>
> This sounds familiar... what does the dependency on the EJB look like?
>  Does it have a <type>?

The dependency in the child1 module on child2 is as following:

    <dependency>
      <groupId>at.co.xss.mhtest.multimodule</groupId>
      <artifactId>child2</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>

No <type> is in this. However, my original project had used 
<type>client</type> which didn't make a diffence.

- martin

Re: problems building a multimodule project with EJB3 modules

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Apr 23, 2008 at 5:08 PM, Martin Höller <ma...@xss.co.at> wrote:

>  I'm having problems with a multimodule project with EJB3 dependencies. It
>  seems maven is not able to include EJB3 modules in the classpath of other
>  child-modules when not in the local repository. The simplest project
>  struture to reproduce is the following:

This sounds familiar... what does the dependency on the EJB look like?
 Does it have a <type>?

-- 
Wendy

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


Re: problems building a multimodule project with EJB3 modules

Posted by Daniele De Francesco <dd...@gmail.com>.
Hi again,

check every dependency scope in the poms...however try to set common
dependencies up in the super-pom and use the <parent> tag to address it from
the module poms...

as to send my poms, here is a (simple yet working) of my config.

super-pom:

[...]
    <groupId>ejb3maven</groupId>
    <artifactId>ejb3maven</artifactId>
    <version>0.0.1</version>
    <name>EJBDeployer</name>
[...]
    <packaging>pom</packaging>
    <modules>
        <module>wsappclient</module>
        <module>ejb</module>
        <module>web</module>
        <module>ear</module>
    </modules>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
[...]

ejb module:

[...]
  <parent>
    <groupId>ejb3maven</groupId>
    <artifactId>ejb3maven</artifactId>
    <version>0.0.1</version>
  </parent>
    <groupId>ejb3maven</groupId>
    <artifactId>ejb3maven-ejb</artifactId>
    <packaging>ejb</packaging>
    <version>0.0.1</version>

[...]

 <dependencies>
      <dependency>
          <groupId>jboss-ejb3-embeddable_alpha3</groupId>
          <artifactId>antlr-2.7.5H3</artifactId>
          <version>1.0alpha3</version>
      </dependency>

      <dependency>
              <groupId>commons-collections</groupId>
              <artifactId>commons-collections</artifactId>
              <version>3.2</version>
          </dependency>

      <dependency>
          <groupId>jboss-ejb3-embeddable_alpha3</groupId>
          <artifactId>hibernate-all</artifactId>
          <version>1.0alpha3</version>
      </dependency>
      <dependency>
          <groupId>jboss-ejb3-embeddable_alpha3</groupId>
          <artifactId>jboss-ejb3-all</artifactId>
          <version>1.0alpha3</version>
      </dependency>
      <dependency>
          <groupId>jboss-ejb3-embeddable_alpha3</groupId>
          <artifactId>thirdparty-all.jar</artifactId>
          <version>1.0alpha3</version>
      </dependency>
      <dependency>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging-api</artifactId>
          <version>1.1</version>
      </dependency>

</dependencies>

[...]

hope this helps...

Regards
--
Daniele De Francesco

On Wed, Apr 23, 2008 at 11:08 AM, Martin Höller <ma...@xss.co.at> wrote:

> Hi all!
>
> I'm having problems with a multimodule project with EJB3 dependencies. It
> seems maven is not able to include EJB3 modules in the classpath of other
> child-modules when not in the local repository. The simplest project
> struture to reproduce is the following:
>
> parent (packagin pom)
>  |
>  +-- child1 (packagin jar)
>  |
>  `-- child2 (packagin ejb)
>
> where child1 depends on child2. When I execute "mvn package" (with an
> empty
> local repository) from the parent child2 is packaged and then I get a
> missing dependency in child1 on child2:
>
>
> INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) at.co.xss.mhtest.multimodule:child2:jar:1.0-SNAPSHOT
> [...]
>
> However, when I execute "mvn install" instead everything compiles and
> packages fine.
>
> The problem seems to be that maven is not able to include the classes of
> the
> child2 module in the classpath of child1 when it is compiling child1. When
> a "mvn install" is executed, the final jar is in the local repo and
> correctly included in the classpath, so this shows no problems.
>
> Is this behaviour with EJB3 modules intentional, am I missing something
> here
> or is this a bug?
>
> Thanks for your suggestions,
> - martin
>
>
>