I'm sure this has been answered a million times before, but I could not find
it in the Wiki, FAQ or archives.

Using beta 10, I have a J2EE setup that is very similar to the "everest"
example from those J2EE slides that someone mentioned a while ago, with one
big difference: our main .war file includes jar files that are built from
code, so are part of the build process.

Using reactor, I can either get everything to compile OR process sub
projects in the correct dependency order. That is, one of these situations
happens:

1) Reactor compiles all of the projects, but dependency order is completely
wrong (first .war compiles, then .ear, THEN the .jars that the .war depends
on compile).

2) The dependency order is correct, but nothing builds due to an annoying
error (described below).


Say I have the following layout:

maven.xml  (Main project)
applications/registration/project.xml  (Builds foo.ear)
modules/web/project.xml   (Builds foo.war)
modules/bar/project.xml   (Builds bar.jar from source code)

I want foo.ear to contain foo.war which contains bar.jar. This means bar.jar
needs to get built first, then foo.war, then foo.ear.

As near as I can figure, the only way to control the build order using
reactor is to set up the dependencies in a certain way:

modules/bar/project.xml

<project>
        ... snip ...
  <id>bar</id>
      ... snip ...
</project>

modules/web/project.xml

<project>
  <id>foo</id>
  <groupid>foo</groupid>
        ... snip ...
  <dependencies>
      <dependency>
         <groupId>foo</groupId>
         <artifactId>bar</artifactId>
        ... snip ...
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
        ... snip ...
  </dependencies>
        ... snip ...
</project>

This seems to make reactor build things in the correct order, but I get this
message:

Attempting to download bar-1.3.jar.
Error retrieving artifact from
[http://www.ibiblio.org/maven/foo/jars/bar-1.3.jar]: java.lang.Exception:
Can't get bar-1.3.jar to 
<path>\repository\foo\jars\bar-1.3.jar
WARNING: Failed to download bar-1.3.jar.

I look at this error and think "yes. no shit. I'm tring to build bar-1.3.jar
from code, dinkus. It won't be in the repository. Just build it."

What am I doing wrong, here?

On the other hand, if remove bar from modules/web/project.xml, bar builds at
the wrong time.

Wordman

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to