Maven 2 & 3

mvn package does not work on J2EE multi module build

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0.4
  • Fix Version/s: None
  • Component/s: Reactor and workspace
  • Labels:
    None
  • Environment:
    Linux, J2SE 1.4
  • Complexity:
    Intermediate
  • Number of attachments :
    2

Description

In a multi module build consisting of an ejb.jar (with an ejb-client.jar), a war, and an ear where the war depends on the ejb-client.jar and the ear depends on the ejb.jar and the war, a reactor build with

mvn package

fails. The war build tries to download the ejb-client.jar from the repository instead of using the just built version.

If I first run 'mvn install' in the ejb module the following multi module 'mvn package' succeeds.

This issue causes also problems for the realease plugin since the sub build fails.

Issue Links

Activity

Hide
Varghese C V added a comment -

Similar behavior with version 2.0.6. I am running a multi-module JEE build. It works when maven package is run on the web project alone. But when in a multi-module build the ejb-client dependency in the web project fails for reactor artifacts as well as installed local repository artifacts.

Show
Varghese C V added a comment - Similar behavior with version 2.0.6. I am running a multi-module JEE build. It works when maven package is run on the web project alone. But when in a multi-module build the ejb-client dependency in the web project fails for reactor artifacts as well as installed local repository artifacts.
Hide
Varghese C V added a comment -

http://jira.codehaus.org/browse/MWAR-59 seems to address the same issue

Show
Varghese C V added a comment - http://jira.codehaus.org/browse/MWAR-59 seems to address the same issue
Hide
Silvestrov Ilya added a comment -

A simple test case attached.
When second/pom.xml has
<dependency>
<groupId>${groupId}</groupId>
<artifactId>first</artifactId>
<version>${version}</version>
<type>ejb</type>
</dependency>
it works.
With <type>ejb-client</type> it fails.

C:\Ilya\test_projects\maven_multimodule_ejb\second>mvn -v
Maven version: 2.0.9
Java version: 1.5.0_10
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

Show
Silvestrov Ilya added a comment - A simple test case attached. When second/pom.xml has <dependency> <groupId>${groupId}</groupId> <artifactId>first</artifactId> <version>${version}</version> <type>ejb</type> </dependency> it works. With <type>ejb-client</type> it fails. C:\Ilya\test_projects\maven_multimodule_ejb\second>mvn -v Maven version: 2.0.9 Java version: 1.5.0_10 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Hide
John Casey added a comment -

Can you re-check this using Maven 2.1.0? I put in a fix for similar situations...ejb-client and other types of secondary artifacts are called "attachments", and I added some code to search the reactor projects for attached artifacts in 2.1.0...

Show
John Casey added a comment - Can you re-check this using Maven 2.1.0? I put in a fix for similar situations...ejb-client and other types of secondary artifacts are called "attachments", and I added some code to search the reactor projects for attached artifacts in 2.1.0...
Hide
John Casey added a comment -

This is a mockup project that should display the problems described in this issue. If you look in the root directory at the build.log file, you'll notice that when using Maven 2.1.0, the ejb-client jar is used from the reactor project, and not from the local repository (it doesn't even exist in my local repository at the time when this log file was taken).

If this test is in error, please reopen the issue.

Show
John Casey added a comment - This is a mockup project that should display the problems described in this issue. If you look in the root directory at the build.log file, you'll notice that when using Maven 2.1.0, the ejb-client jar is used from the reactor project, and not from the local repository (it doesn't even exist in my local repository at the time when this log file was taken). If this test is in error, please reopen the issue.
Hide
John Casey added a comment -

seems to have been fixed in maven 2.1.0, though I can't be sure.

Show
John Casey added a comment - seems to have been fixed in maven 2.1.0, though I can't be sure.

People

Vote (9)
Watch (8)

Dates

  • Created:
    Updated:
    Resolved: