This is not how you should do things IMHO. You should make your common
jar generic enough so it can be used on the client side and the sever
side without adjustment (changing the jar). Any client side specific
code should go into the client module (producing the client jar) which
has a dependency to the common artifact (jar). Any server side
specifics should go in the server module, also with a dependency to
the common jar.

The key thing in Maven, and in Java in general now a days I'd say, is
to produce "generic" (re-usable) jars. And then add configuration etc.
to fit you specific need.

You should be able to look at any smaller Maven multi-module project
and see how this works.

/Anders

On Mon, Sep 10, 2012 at 6:23 PM, Julian Wiesner <[email protected]> wrote:
> Dear Maven User Community,
>
> I have just recently started using Maven and I’m intrigued by it. It’s the
> first time I’m using a build management tool, but I have come across a few
> problems. I’ve been searching the wiki and forums for a while and I haven’t
> seen a scenario that particularly pertained to my case.
>
> I have a project that I'd like to set up as follows:
> &#9830; A parent project that acts as a shell. It only contains a site (if
> even
> necessary).
> &#9830; With 3 modules:
>     &#9830; A client module where the code is adjusted to fit a client
> side jar.
> i.e. Add classes, change code in common classes.
>     &#9830; A server module where the code is adjusted to be a server side
> jar.
>     &#9830; A common code module where all of the main code is placed.
> This is the
> main development module. The client module and server module use this source
> code and then build either a server jar or a client jar within their target
> directory. This module by itself would never be built. It acts strictly as a
> source for the other 2 modules.
>
> I'm planning on managing development of this project on Github and then have
> it set up on Hudson-CI for deployment. There will be 3 simultaneous
> branches. One for the main executable content, one for the client side of
> things and one for the server side. Major releases will be tagged in the
> main executable branch and any patches to the client and server side aspects
> in their respective branches. This will allow me to continue development of
> the main content, but also be able to assure the content works in different
> environments. e.g. App1.10-server1.12.jar, App1.10-server1.20.jar,
> App1.20-server1.20, App1.20-client1.20. Also the client and server patches
> will happen in sync.
>
> My question is:
> How would I set up such a maven project? Are there any good resources that
> you recommend where I can do some further investigating? Is there a simpler
> solution?
>
> Thank you for your help.
>
> Sincerely,
>
> Julian Wiesner
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to