Hello!

I have a project that I'd like to convert into a maven2 multi-module
project. The thing is that this is the first time I'm using maven, and on
top of that the project also contains a bit of AspectJ code. 

- project
---- server (depends on model.io, protocol.game and protocol.login)
---- event (depends on model, contains aspects)
---- model (depends on nothing)
---- model.io (depends on model)
---- net (depends on nothing)
---- protocol (depends on net)
---- protocol.game (depends on net and model, contains aspects)
---- protocol.login (depends on net and model)

The server module is the current main application entry point, and depends
on model.io, protocol.game and protocol.login. Both the event and
protocol.game modules contains AspectJ code which needs to be woven into
classes in the model module. 

Now, when I build the project, it seems as if the aspects are applied
properly when the event and protocol.game modules are compiled, but when I
actually start the application, it doesn't work. I've noticed three possible
situations:

1. When the first dependency in the server module's dependency list is
model.io, then a clean version of the model module is used in the resulting
program, containing no AspectJ functionality whatsoever.
2. When the first dependency in the server module's dependency list is
protocol.game, then all aspects defined in protocol.game seems to work just
fine, but the ones from the event module is nowhere to be seen. 
3. When the first dependency in the server module's dependency list is
event, then all aspects defined in event seems to work just fine, but the
ones from the protocol.game module is nowhere to be seen. 

In all of the above cases, all three dependencies are in the server module's
pom.xml file, the only difference is the order in which the dependencies are
listed in the file. 

To me it seems like, when a maven project first either directly or
indirectly depends on something (in this case the model module), it uses
that first instance of it, and ignores future dependencies on that same
module, and whenever the event or protocol.main (or any other package for
that matter) uses the model module, it gets a clean Java version of it
instead of using the last compiled one. 

Uploading the pom files of the relevant modules:
http://www.nabble.com/file/p22112224/pomfiles.zip pomfiles.zip 

Have I completely misunderstood how to use maven with aspectj, or is there
at least something I can do to make it work? I'm guessing it could work if I
move all the aspects into a separate single module so that all of them can
be applied at the same time, but that would kindof mess up modularity. 

I'd really appreceate any help I can get on this. Thanks in advance!

Yours, Jiddo.
-- 
View this message in context: 
http://www.nabble.com/Maven2-%2B-AspectJ%3A-Need-help---multiple-weaving-of-module-project%21-tp22112224p22112224.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to