Hi all,
I have a WAR which exposes an extension point: MyStrategyInterface. I then
have a number of clients who all provide their own implementation of said
extension. The code is structured so there is a web-project and then
multiple client-projects which only contain the extension point. The build
(using gradle) in each client project builds the WAR, unpacks it, inserts
the client JAR into WEB-INF/lib and then repacks the WAR. Yes, I know.
Really :)
Logically at runtime, there is a circular dependency - the WAR *requires* a
client and the client has a static dependency on the strategy in the WAR,
but we can get away with it because one direction is at compile time and the
other is at run-time.
How would I do this with maven?
My thoughts:
- include the clients in separate source trees in the web project and use
profiles or an environment variable to select which one to include (i.e. mvn
-Dclient=clientX would include the source code for clientX). The client's
have their own tests as well, so I would need to do this for the testing
lifecycle as well.
- use the existing structure and do some custom magic at certain points in
the assembly lifecycle in the client - building the client war is done by
the client project
- separate out the strategy into its own project and then do some magic to
change the dependency in the WAR to one of the client projects - build the
client war is done by the web project
This cannot be a unique requirement - and I have read the manual, but it
just isn't clicking... I am not sure what terminology to search for in
google either I understand (and am using elsewhere) pom hierarchies,
but this needs more than that I think.
Help please :)
(I am using maven3)
Col