multi module install has a race condition
-----------------------------------------

                 Key: MNG-2507
                 URL: http://jira.codehaus.org/browse/MNG-2507
             Project: Maven 2
          Issue Type: Bug
          Components: Bootstrap & Build, Dependencies
    Affects Versions: 2.0.4
         Environment: Windows XP SP1; netbeans 5.0 using maven2 plugin; running 
on a notebook, disconnected from any central repository using only the local 
repository
            Reporter: Stefan Stieglitz


Multi module projects (using a root project with pom packaging) are likely to 
run into a race condition when performing a multi module build. It seems to me 
that the installing of a just build (jar-) file for module A and the compile 
goal of the next build of a module B, run both in different threads. These 
threads are not sufficently synchronized. This can result in an "artifact is 
missing" error if B has a dependeny on A. Even worse, if an old jar from a 
previous build is still in place, module B is compiled against old code. To 
handle this, one has to search for any dependencies and build all modules 
manually in an appropriate order.
It is likely that this bug has no effect, if an up to date central repository 
is accessible.

Suggestion to fix this: Wait until each build is completely finished, before 
performing the next step of a multi module build.

Simplified example POMs:

root:
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>vendor</groupId> 
  <artifactId>root</artifactId>
  <name>root</name>
   <packaging>pom</packaging>
  <modules>
    <module>A</module>
    <module>B</module>
  </modules>
</project>

module A:
<project>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>vendor</groupId>
        <artifactId>root</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <artifactId>A</artifactId>
    <name>A</name>
    <packaging>jar</packaging>
</project>

module B:
 <project>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>vendor</groupId>
        <artifactId>root</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <artifactId>B</artifactId>
    <name>B</name>
    <packaging>jar</packaging>
   <dependencies>
        <dependency>
            <groupId>vendor</groupId>
            <artifactId>A</artifactId>
            <version>1.0-SNAPSHOT</version>
         </dependency>
   </dependencies>
</project>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to